Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi all, My code has been running fine up to this point, so hopefully someone can help me out. I am trying to create several worksheets in a workbook to be populated later in the program, and then proceed to create charts. Previously, I had only created one extra worksheet prior to making charts, but as soon as I add a second blank worksheet, I get a weird error in my charting sub. Here is the code from the calling function: Application.StatusBar = "Creating output worksheets" Set ws = wb.Worksheets.Add ws.Name = "Output" Set outputPage = ws.Cells Set ws1 = wb.Worksheets.Add ws1.Name = "DataSet 1" Set page1 = ws1.Cells Call AddCharts(wb, outputPage, page1) And here is the code from the charting function: Set case1 = wb.Charts.Add With case1 ChartType = xlXYScatterLinesNoMarkers Location Whe=xlLocationAsNewSheet, Name:="(1)V&I Graph" HasTitle = True VBA says that there is an error in the .HasTitle line and will not allow me to proceed until .HasTitle is either commented out of made false. What gives? Any help would be greatly appreciated. Thanks! -- 3PhaseMacroMan ------------------------------------------------------------------------ 3PhaseMacroMan's Profile: http://www.excelforum.com/member.php...o&userid=29945 View this thread: http://www.excelforum.com/showthread...hreadid=496433 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have run across this before, I think: I don't think you can set HasTitle =
True until the chart has at least one data series. Try specifying your data range first (e.g. SetSourceData, or create a seriescollection) and then set HasTitle=True. Tested on win2000/Excel2000; using your code got same error but doing ..SetSourceData before .HasTitle got it to work OK. -- - K Dales "3PhaseMacroMan" wrote: Hi all, My code has been running fine up to this point, so hopefully someone can help me out. I am trying to create several worksheets in a workbook to be populated later in the program, and then proceed to create charts. Previously, I had only created one extra worksheet prior to making charts, but as soon as I add a second blank worksheet, I get a weird error in my charting sub. Here is the code from the calling function: Application.StatusBar = "Creating output worksheets" Set ws = wb.Worksheets.Add ws.Name = "Output" Set outputPage = ws.Cells Set ws1 = wb.Worksheets.Add ws1.Name = "DataSet 1" Set page1 = ws1.Cells Call AddCharts(wb, outputPage, page1) And here is the code from the charting function: Set case1 = wb.Charts.Add With case1 ChartType = xlXYScatterLinesNoMarkers Location Whe=xlLocationAsNewSheet, Name:="(1)V&I Graph" HasTitle = True VBA says that there is an error in the .HasTitle line and will not allow me to proceed until .HasTitle is either commented out of made false. What gives? Any help would be greatly appreciated. Thanks! -- 3PhaseMacroMan ------------------------------------------------------------------------ 3PhaseMacroMan's Profile: http://www.excelforum.com/member.php...o&userid=29945 View this thread: http://www.excelforum.com/showthread...hreadid=496433 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Data Labels, Error Bars, and Dynamic Charting | Charts and Charting in Excel | |||
CHARTING CODE ERROR | Excel Discussion (Misc queries) | |||
charting and vloookup function | Charts and Charting in Excel | |||
Charting error in Excel2003 | Charts and Charting in Excel | |||
Charting - Cells and Range - Error 1004 | Excel Programming |