Runtime error '1004' Method 'Location' of object '_Chart' failed

tulaamar

New Member
Joined
Apr 3, 2014
Messages
2
Hello all,

I am currently working on a code, which is used to visualize graphs. I copy paste the data from other work books and create the graph. It works fine in the debugging mode, however I come across run time error when I run the macro.
Code:
Call createchart1(j, k, j + i1 - 1)        Application.ActiveChart.Parent.Name = "Reached Target1"
[B]        ActiveChart.Location Where:=xlLocationAsObject, Name:="Week" & i & "_Visualization"[/B]
        ActiveSheet.ChartObjects("Reached Target1").Activate
        ActiveChart.PlotArea.Select
        ActiveChart.ChartArea.Select
        ActiveSheet.Shapes("Reached Target1").IncrementLeft -217.6118897638
        ActiveSheet.Shapes("Reached Target1").IncrementTop -82.9411811024
        With ActiveSheet.Shapes("Reached target1")
             .Height = 250 ' resize
             .Width = 360  ' resize
             .Top = 0
        End With
The bold line is where I have the error. The error is displayed is [h=2]Runtime error '1004' Method 'Location' of object '_Chart' failed[/h]. Please help.
 
Last edited:

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Found the solution. I was encountering this error due to some comments I had at the beginning.
 
Upvote 0

Forum statistics

Threads
1,216,361
Messages
6,130,180
Members
449,563
Latest member
Suz0718

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