Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default chartobjects.activate fails

I have the following snipet in my code

Windows("abc.xls").Activate
Sheets("Profile").Select
ActiveSheet.ChartObjects(1).Activate

When I get to the 3rd line I get a "runtime error 1004". I have verified
that the sheet does contain a chart. I have used this in other workbooks
with no problem. What is wrong here?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default chartobjects.activate fails

Try replacing the index with chart name.

ActiveSheet.ChartObjects("ChartName").Activate

Jacob
----------
(If this post helps please hit Yes)


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default chartobjects.activate fails

Same thing happens


"Jacob Skaria" wrote:

Try replacing the index with chart name.

ActiveSheet.ChartObjects("ChartName").Activate

Jacob
----------
(If this post helps please hit Yes)


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default chartobjects.activate fails

Is the sheet (or chart) protected? Is it the active sheet? Is the chart on a
sheet that's grouped with another sheet, or in a workbook that is shared?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______


"Scooter" wrote in message
...
I have the following snipet in my code

Windows("abc.xls").Activate
Sheets("Profile").Select
ActiveSheet.ChartObjects(1).Activate

When I get to the 3rd line I get a "runtime error 1004". I have verified
that the sheet does contain a chart. I have used this in other workbooks
with no problem. What is wrong here?



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default chartobjects.activate fails

The sheet is not protected. Yes the chart is on the active sheet. The sheet
is not part of a group or shared workbook. This is very strange to me since
I have used this code many times but for this one instance it does not work.

"Jon Peltier" wrote:

Is the sheet (or chart) protected? Is it the active sheet? Is the chart on a
sheet that's grouped with another sheet, or in a workbook that is shared?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______


"Scooter" wrote in message
...
I have the following snipet in my code

Windows("abc.xls").Activate
Sheets("Profile").Select
ActiveSheet.ChartObjects(1).Activate

When I get to the 3rd line I get a "runtime error 1004". I have verified
that the sheet does contain a chart. I have used this in other workbooks
with no problem. What is wrong here?






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default chartobjects.activate fails

Could be a corrupted workbook, to use a trite excuse.

Do you realize that you don't need to do all the activating and selecting
just to modify something in the chart? If your next line of code is (for
example)

ActiveChart.HasTitle = True

you can achieve the same using

Workbooks("abc.xls").Worksheets("Profile").ChartOb jects(1).Chart.HasTitle
= True

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______


"Scooter" wrote in message
...
The sheet is not protected. Yes the chart is on the active sheet. The
sheet
is not part of a group or shared workbook. This is very strange to me
since
I have used this code many times but for this one instance it does not
work.

"Jon Peltier" wrote:

Is the sheet (or chart) protected? Is it the active sheet? Is the chart
on a
sheet that's grouped with another sheet, or in a workbook that is shared?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______


"Scooter" wrote in message
...
I have the following snipet in my code

Windows("abc.xls").Activate
Sheets("Profile").Select
ActiveSheet.ChartObjects(1).Activate

When I get to the 3rd line I get a "runtime error 1004". I have
verified
that the sheet does contain a chart. I have used this in other
workbooks
with no problem. What is wrong here?






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ChartObjects Scott Excel Programming 1 June 30th 06 12:23 AM
Activate method of Worksheet class fails in Excel 2000 Chris Bloom Excel Discussion (Misc queries) 3 September 10th 05 12:05 AM
Activate fails when someone else is in the sheet InsideTGT Excel Programming 0 August 30th 05 03:07 PM
Activate ChartObjects on protected sheet?? RAP Excel Programming 0 August 26th 05 05:45 AM
ChartObjects Nick Excel Programming 2 August 19th 04 12:04 PM


All times are GMT +1. The time now is 12:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"