944,028 Members | Top Members by Rank

Ad:
Nov 14th, 2006
0

excel

Expand Post »
hi again.. i have a problem with excel.. tried to print a chart using excel nia vb but it doesnt work and when it does, it keep producing charts tat are infinity..ALOT OF chart without stopping! HELP!!

Private Sub cmdExcel_Click()
'
'
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
'Dim xlColumn As Axis
'Dim xlLocationAsObject As Axis




Set xlApp = New Excel.Application
Set xlBook = xlApp.Workbooks.Add
Set xlSheet = xlBook.Worksheets.Add

With xlApp
.Visible = True

' Macro recorded 11/14/2006 by CrashOverride



.Range("A2").Select
.ActiveSheet.Paste
.Range("B2").Select
.ActiveSheet.Paste
.ActiveWindow.SmallScroll Down:=0
.Range("C2").Select
.ActiveSheet.Paste
.ActiveWindow.SmallScroll Down:=-3
.Range("A3:A9").Select
.ActiveWindow.SmallScroll Down:=-9
.Range("A1:C36").Select
.ActiveWindow.SmallScroll Down:=3
.Range("B35").Select
.ActiveCell.FormulaR1C1 = "12.94"
.Range("A1:C36").Select
.Range("C36").Activate
.Charts.Add
.ActiveChart.ChartType = xlLine
.ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("A1:C36"), PlotBy _
:=xlColumns
.ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet1"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Assembly Mistakes"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "No of ribs"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Tolerance"
End With
.ActiveSheet.Shapes("Chart 1").ScaleWidth 1.5, msoFalse, msoScaleFromTopLeft
.ActiveChart.Legend.Select
.Selection.Position = xlBottom
.ActiveChart.Axes(xlValue).Select
.Windows("Book2").SmallScroll Down:=-3
End With

End Sub
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Nurilhansiz is offline Offline
3 posts
since Nov 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Connect to PHP
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Auto-resizing images in the IE Browser control





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC