create embeded chart at specific location

adr12345

Board Regular
Joined
Jan 19, 2015
Messages
67
I am using this code to create an embeded chart from pivot table.

Dim pt As PivotTable
Dim myChartObject As ChartObject
Sheets("AOSTESUMMARY").Select
Set pt = Sheets("AOSTESUMMARY").PivotTables(1)
pt.TableRange1.Select
Worksheets("AOSTESUMMARY").ChartObjects.Add Left:=500, Top:=500, Width:=300, Height:=300


However charts is created at unspecific location.
say I want to create chart at cell "C1"..

what should be my code?
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
also
Dim chrtrng As range
Dim pt As PivotTable
Set pt = Sheets("AOSTESUMMARY").PivotTables(1)
Set chrtrng = pt.TableRange1
ActiveChart.SetSourceData Source:=range("chrtrng")
ActiveChart.ChartType = xl3DPie

I tried different code..
Code is getting stuck at the line in bold... need help
 
Upvote 0

Forum statistics

Threads
1,215,263
Messages
6,123,956
Members
449,135
Latest member
jcschafer209

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top