Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Paste chart images macro fails

Hi all,

We are using Excel for reporting in our organization. Basically there is a
Java web application which instantiates Excel 2007 with an XLAM. This XLAM
opens a Report Template(an .xls, .xlsm file, name supplied as command line
parameter). The Template has a datasheet where we have multiple ranges and
the Reportsheet which shows the final report based on the data from the
Datasheet. The Reportsheet contains formulas to show the final output. It
could contain Charts/Graphs also. The data is fetched from SQL server and is
pasted on the Ranges. And finally when all the data is pasted and Macro is
run the Template is saved as a Final Report somewhere on the Report Server.
The Excel runs in the background in all this process. There could be multiple
instances of Excel running on the same box. The instances run under separate
WindowStation.

In this process a macro,PasteChartAsGraphic, present in the template is
invoked by the XLAM. The macro basically is about pasting the images of the
charts present in the template and later deleting the original charts. So the
template would be left with the chart images instead of actual chart objects
after the macro is Run.

The macro executes successfully for most of the times but failes randomly
with different errors. Last time it failed with the following error. Excel
ends up in showing the following dialog box.

"Microsoft Visual Basic". The dialog contained the following text content:
[Run-time error '-2147417848 (80010108)':##Method 'CopyPicture' of object
'ChartObject' failed][&Continue][&End][&Debug][&Help]

I can post the macro code if anybody is interested in looking into it.

If anybody have any idea please let me know as it is a blocking issue in our
process.

Any help appreciated.

Thanks in advance.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Paste chart images macro fails

Errors like 2147417848 (80010108)' I usally find are caused by one of two
reasons

1) The window or form lost the focus. Some other window has activated
another window taking the focus. Tthe code is pasting the picture into the
wrong active window. Make sure you are referenceing the window/form by an
object name and not using the active window.

2) A similar problem to one abvove if you have multiple forms and you don't
have the priledge from one form to access another form because the form is
declared as private.

"Anand Nichkaode" wrote:

Hi all,

We are using Excel for reporting in our organization. Basically there is a
Java web application which instantiates Excel 2007 with an XLAM. This XLAM
opens a Report Template(an .xls, .xlsm file, name supplied as command line
parameter). The Template has a datasheet where we have multiple ranges and
the Reportsheet which shows the final report based on the data from the
Datasheet. The Reportsheet contains formulas to show the final output. It
could contain Charts/Graphs also. The data is fetched from SQL server and is
pasted on the Ranges. And finally when all the data is pasted and Macro is
run the Template is saved as a Final Report somewhere on the Report Server.
The Excel runs in the background in all this process. There could be multiple
instances of Excel running on the same box. The instances run under separate
WindowStation.

In this process a macro,PasteChartAsGraphic, present in the template is
invoked by the XLAM. The macro basically is about pasting the images of the
charts present in the template and later deleting the original charts. So the
template would be left with the chart images instead of actual chart objects
after the macro is Run.

The macro executes successfully for most of the times but failes randomly
with different errors. Last time it failed with the following error. Excel
ends up in showing the following dialog box.

"Microsoft Visual Basic". The dialog contained the following text content:
[Run-time error '-2147417848 (80010108)':##Method 'CopyPicture' of object
'ChartObject' failed][&Continue][&End][&Debug][&Help]

I can post the macro code if anybody is interested in looking into it.

If anybody have any idea please let me know as it is a blocking issue in our
process.

Any help appreciated.

Thanks in advance.

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
Copy/Paste in VBA fails? Maury Markowitz[_2_] Excel Programming 2 September 10th 08 06:36 PM
Chart.Export images are shrinking as I export more images Jared Charts and Charting in Excel 3 January 29th 08 03:23 AM
Copy and paste images Mark Ivey Excel Discussion (Misc queries) 1 December 5th 06 03:33 AM
Macro fails in Pie Chart - Can Microsoft / MVP please comment Jay Charts and Charting in Excel 2 November 19th 05 12:28 PM
Paste method fails in VBA lalu Excel Programming 4 October 14th 05 03:06 AM


All times are GMT +1. The time now is 02:17 PM.

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

About Us

"It's about Microsoft Excel"