Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2006
Posts: 3
Reputation: Nurilhansiz is an unknown quantity at this point 
Solved Threads: 0
Nurilhansiz Nurilhansiz is offline Offline
Newbie Poster

excel

 
0
  #1
Nov 14th, 2006
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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC