Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello all
I am trying to add a chart as the very last sheet in a workbook. I have the following VB 6.0 code. Using Excel 2003. Option Explicit Dim excelApp As New Excel.Application Dim excelBook As Excel.Workbook Dim excelSheet(0 To 3) As Excel.Worksheet Dim excelchart(0 To 3) As Excel.Chart Private Sub Command1_Click() excelApp.Visible = True Set excelBook = excelApp.Workbooks.Add Set excelSheet(0) = excelBook.Worksheets.Add With excelBook ..Sheets.Add After:=.Worksheets(Worksheets.Count), Type:=xlChart End With End Sub What I notice is that even though I specify to add the chart after the very last sheet, it already adds it right before the last. I didnt see anything in the documentation that would lead me to believe that this is expect behavior. I know I can move the chart to be the last sheet and thats how Im working around this. Did I just miss something? Can someone shed some light on this behavior? It might have to do with adding sheets of different types, because I dont see this happen if I add a WorkSheet instead of a chart. I know im not the only one seeing this. Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Save chart (that's on a chart sheet) to html file? | Charts and Charting in Excel | |||
Check Activesheet for chart sheet or work sheet | Charts and Charting in Excel | |||
???Replicate a sheet but chart still link to original sheet | Charts and Charting in Excel | |||
Moving Pivot Chart Fields on a chart sheet | Charts and Charting in Excel | |||
Dynamic column chart - copying from Sheet to Sheet. | Charts and Charting in Excel |