Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Chart location and source...
Is this the proper order for creating a shart, or am I missing some thing
else? xlapp.Workbooks(strXlsFile).Charts.Add.Location whe=xlLocationAsObject, Name:=strSheetName xlapp.Workbooks(strXlsFile).Charts.Add.ChartType = xlLineMarkers xlapp.Workbooks(strXlsFile).ActiveChart.SetSourceD ata Source:= _ xlapp.Workbooks(strXlsFile).Worksheets(j + 1).Cells(1, 3), PlotBy:=xlColumns xlapp.Workbooks(strXlsFile).ActiveChart.HasLegend = False xlapp.Workbooks(strXlsFile).ActiveChart.ApplyDataL abels Type:=xlDataLabelsShowValue I am rather new to the world of Excel charting... any help is appreciated! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Chart location and source...
Are you having problems? Or is this an academic question?
If the former, switch the sequence of the .ChartType and the ..SetSourceData statements. A good -- though not perfect -- way of getting the necessary code is to use XL's macro recorder. Turn it on (Tools | Macro Record new macro...), create the chart by hand, turn off the recorder, and switch to the VBE. Also, you may want to look at the VB(A) With statement as well as the possibility of setting a variable of type excel.workbook to refer to workbooks(strxlsfile). -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article , says... Is this the proper order for creating a shart, or am I missing some thing else? xlapp.Workbooks(strXlsFile).Charts.Add.Location whe=xlLocationAsObject, Name:=strSheetName xlapp.Workbooks(strXlsFile).Charts.Add.ChartType = xlLineMarkers xlapp.Workbooks(strXlsFile).ActiveChart.SetSourceD ata Source:= _ xlapp.Workbooks(strXlsFile).Worksheets(j + 1).Cells(1, 3), PlotBy:=xlColumns xlapp.Workbooks(strXlsFile).ActiveChart.HasLegend = False xlapp.Workbooks(strXlsFile).ActiveChart.ApplyDataL abels Type:=xlDataLabelsShowValue I am rather new to the world of Excel charting... any help is appreciated! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
pasting chart getting source data from new location | Charts and Charting in Excel | |||
How to identify source or location of MAX_VALUE in range | Excel Worksheet Functions | |||
Changing Query Source Location? | Excel Programming | |||
Changing Query source location? | Excel Programming | |||
Query source location - how do I change? | Excel Programming |