PC Review


Reply
Thread Tools Rate Thread

Charts.add or ActiveSheet.ChartObjects.Add doesn't work

 
 
Oliver
Guest
Posts: n/a
 
      28th Sep 2010
Hello All,
I am working with Excel 2007 and I would like to create a chart via a
macro.
If I use:
Charts.add

Then I can see how Excel creates a tab with the new chart and
immediately deletes it again.

When I create the chart with

with ActiveSheet.ChartObjects.Add (Left:=100, Width:=375, Top:=75,
Height:=225)
end with
I get the following error message
Run-time error '-2147467259(80004005)':
Automation error
Unspecified error

The macro works on a different computer.

Does anybody have an idea what could cause this problem?

Thanks,
Oliver
 
Reply With Quote
 
 
 
 
Jon Peltier
Guest
Posts: n/a
 
      29th Sep 2010
I don't know what might result in this error. This line:

> The macro works on a different computer.


sheds some light. It may mean that some gremlin has crept into the
misbehaving computer, or perhaps not all updates and service packs have
been applied.

First step: apply updates and service packs. Second step if needed: run
diagnostics (Office button > Excel Options > Resources > Run Microsoft
Office Diagnostics). Third step if needed: reinstall Office.

- Jon
-------
Jon Peltier
Peltier Technical Services, Inc.
http://peltiertech.com/


On 9/28/2010 2:40 PM, Oliver wrote:
> Hello All,
> I am working with Excel 2007 and I would like to create a chart via a
> macro.
> If I use:
> Charts.add
>
> Then I can see how Excel creates a tab with the new chart and
> immediately deletes it again.
>
> When I create the chart with
>
> with ActiveSheet.ChartObjects.Add (Left:=100, Width:=375, Top:=75,
> Height:=225)
> end with
> I get the following error message
> Run-time error '-2147467259(80004005)':
> Automation error
> Unspecified error
>
> The macro works on a different computer.
>
> Does anybody have an idea what could cause this problem?
>
> Thanks,
> Oliver

 
Reply With Quote
 
Oliver
Guest
Posts: n/a
 
      29th Sep 2010
Hi Jon,
I tried step one and two, I am now at step three :-)

I was hoping that there might be another solution.

Thanks again,
Oliver
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
vba to hide two grouped charts in 2003 - doesn't work Harold Good Microsoft Excel Charting 0 17th Dec 2009 09:03 PM
looping through chartobjects returns deleted charts also Rolf Barbakken Microsoft Excel Programming 2 12th Jan 2006 01:19 PM
Looping Through Charts / ChartObjects William Benson Microsoft Excel Programming 2 29th Jun 2005 01:47 AM
Creating a new chart- why Set NewChart = Charts.Add doesn't work? Thief_ Microsoft Excel Charting 7 1st May 2005 03:32 AM
Workbook-Events donīt work with ChartObjects geissma Microsoft Excel Programming 0 16th Sep 2003 01:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:03 AM.