Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Strnage bug when pasting charts

Hi all,

I have encountered a stange bug. The bug occurs when copying an active
chartobject in Excel to PowerPoint.
(Excel is called from PowerPoint.)

The strange thing about this bug is that it occurs *only* on some pc:s not
on other.
The pc:s (stationary pc:s) have all Office 2003 sp3 MUI version and Windows
XP english all servicepacks installed.
I have tried to change the default printer with no result.

The code is as follows.

===========Code Start==============================

' Grab the existing instance of Excel
Set objExcel = GetObject(, "Excel.Application")

' If we have no Excel instance running warn the user and exit the
sub.
If objExcel Is Nothing Then
Call MsgBox(c_Message_ExcelNotStarted, vbExclamation, g_cAppTitle)
GoTo Routine_Exit
End If

' If no selected chart warn user and exit sub.
If objExcel.ActiveChart Is Nothing Then
Call MsgBox(c_Message_ExcelNoChart, vbExclamation, g_cAppTitle)
GoTo Routine_Exit
End If

===========Code End==============================

The error occurs in this part:

' If no selected chart warn user and exit sub.
If objExcel.ActiveChart Is Nothing Then
Call MsgBox(c_Message_ExcelNoChart, vbExclamation, g_cAppTitle)
GoTo Routine_Exit

End If

It fails on this line
objExcel.ActiveChart

and throws the error.

"Application or user-defined error"

Anybody has seen this before?

Thanks for help.

/Ulrik


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Strnage bug when pasting charts

From the Immediate Window I executed this line:

?activechart is nothing

If I had no active workbook, I got an error. If I had an active workbook, I
got either true or false. You should insert a test for the activeworkbook or
activesheet before the test for the active chart.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Ulrik" <ulriknospamrehn.se wrote in message
...
Hi all,

I have encountered a stange bug. The bug occurs when copying an active
chartobject in Excel to PowerPoint.
(Excel is called from PowerPoint.)

The strange thing about this bug is that it occurs *only* on some pc:s not
on other.
The pc:s (stationary pc:s) have all Office 2003 sp3 MUI version and
Windows XP english all servicepacks installed.
I have tried to change the default printer with no result.

The code is as follows.

===========Code Start==============================

' Grab the existing instance of Excel
Set objExcel = GetObject(, "Excel.Application")

' If we have no Excel instance running warn the user and exit the
sub.
If objExcel Is Nothing Then
Call MsgBox(c_Message_ExcelNotStarted, vbExclamation, g_cAppTitle)
GoTo Routine_Exit
End If

' If no selected chart warn user and exit sub.
If objExcel.ActiveChart Is Nothing Then
Call MsgBox(c_Message_ExcelNoChart, vbExclamation, g_cAppTitle)
GoTo Routine_Exit
End If

===========Code End==============================

The error occurs in this part:

' If no selected chart warn user and exit sub.
If objExcel.ActiveChart Is Nothing Then
Call MsgBox(c_Message_ExcelNoChart, vbExclamation, g_cAppTitle)
GoTo Routine_Exit

End If

It fails on this line
objExcel.ActiveChart

and throws the error.

"Application or user-defined error"

Anybody has seen this before?

Thanks for help.

/Ulrik



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Strnage bug when pasting charts

I'll add this checking for an activeworkbook and sees if it helps.

Thanks for your response!

PS. do you have any idea how the code in it's current form works on some
installations
and never works on these pc:s I mentioned in the original post.


"Jon Peltier" wrote in message
...
From the Immediate Window I executed this line:

?activechart is nothing

If I had no active workbook, I got an error. If I had an active workbook,
I got either true or false. You should insert a test for the
activeworkbook or activesheet before the test for the active chart.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Ulrik" <ulriknospamrehn.se wrote in message
...
Hi all,

I have encountered a stange bug. The bug occurs when copying an active
chartobject in Excel to PowerPoint.
(Excel is called from PowerPoint.)

The strange thing about this bug is that it occurs *only* on some pc:s
not on other.
The pc:s (stationary pc:s) have all Office 2003 sp3 MUI version and
Windows XP english all servicepacks installed.
I have tried to change the default printer with no result.

The code is as follows.

===========Code Start==============================

' Grab the existing instance of Excel
Set objExcel = GetObject(, "Excel.Application")

' If we have no Excel instance running warn the user and exit the
sub.
If objExcel Is Nothing Then
Call MsgBox(c_Message_ExcelNotStarted, vbExclamation, g_cAppTitle)
GoTo Routine_Exit
End If

' If no selected chart warn user and exit sub.
If objExcel.ActiveChart Is Nothing Then
Call MsgBox(c_Message_ExcelNoChart, vbExclamation, g_cAppTitle)
GoTo Routine_Exit
End If

===========Code End==============================

The error occurs in this part:

' If no selected chart warn user and exit sub.
If objExcel.ActiveChart Is Nothing Then
Call MsgBox(c_Message_ExcelNoChart, vbExclamation, g_cAppTitle)
GoTo Routine_Exit

End If

It fails on this line
objExcel.ActiveChart

and throws the error.

"Application or user-defined error"

Anybody has seen this before?

Thanks for help.

/Ulrik





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Strnage bug when pasting charts


"Ulrik" <ulriknospamrehn.se wrote in message
...
I'll add this checking for an activeworkbook and sees if it helps.

Thanks for your response!

PS. do you have any idea how the code in it's current form works on some
installations
and never works on these pc:s I mentioned in the original post.


Excel is like that sometimes (said while rubbing beard and gazing into the
distance).

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______



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
Pasting charts to Word without Gridlines Brian Excel Worksheet Functions 5 August 10th 09 09:10 PM
pasting charts to new bookmarks in Word Kate Excel Programming 2 March 26th 07 07:59 PM
Pasting Charts from Excel to PowerPoint Willow[_5_] Excel Programming 0 April 14th 06 03:23 PM
Pasting worksheet with embedded charts FishMan Charts and Charting in Excel 2 October 5th 05 02:26 PM
Pasting excel sheets with charts Duane Charts and Charting in Excel 1 May 25th 05 09:07 PM


All times are GMT +1. The time now is 10:52 AM.

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"