Hi,
I'm creating an Excel report with a cover page (1st sheet) and a chart on the 2nd sheet, chart values in fields D35-F39. I can create the chart just fine. However, when I try to specify the location as an object on Sheet3, it totally disregards my specifications, and instead places the chart on the first tab every time.
Below is basically the part of my code that I need help with. Even though this says that I want the chart on "Sheet3," the chart ends up on "Sheet1."
I'm using VFP 6.0 SP 5.
.Sheets(3).Select
oSheet = .ActiveSheet
WITH .ActiveWorkbook
.Charts.Add
With .ActiveChart
.SetSourceData(oSheet.Range("D35:F39"),2)
.Location(2, "Sheet3")
EndWith
ENDWITH
Thanks,
Jessica
I'm creating an Excel report with a cover page (1st sheet) and a chart on the 2nd sheet, chart values in fields D35-F39. I can create the chart just fine. However, when I try to specify the location as an object on Sheet3, it totally disregards my specifications, and instead places the chart on the first tab every time.
Below is basically the part of my code that I need help with. Even though this says that I want the chart on "Sheet3," the chart ends up on "Sheet1."
I'm using VFP 6.0 SP 5.
.Sheets(3).Select
oSheet = .ActiveSheet
WITH .ActiveWorkbook
.Charts.Add
With .ActiveChart
.SetSourceData(oSheet.Range("D35:F39"),2)
.Location(2, "Sheet3")
EndWith
ENDWITH
Thanks,
Jessica