Active Sheet

T

Tony Reflinski

In the following expression, how to change "Sheet1" so a
plot will be placed on active sheet?

ActiveChart.Location Where:=xlLocationAsObject, _
Name:="Sheet1"
 
N

Nigel

As I understand it the Active object here is the chart, so there is no
active sheet. So you specify the location of the object by direct reference.
Try using the ChartObject.Add method. Then set the chart objects as
required.

Dim Ash As Worksheet
Set Ash = ActiveSheet 'current active sheet

Dim Ach As ChartObject

Set Ach = Ash.ChartObjects.Add(100, 30, 400, 250)

Cheers
Nigel
 
Top