Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 287
Default Code from Powerpoint VBE not Working in Excel VBE?

With a worksheet object selected in Powerpoint this code works perfectly from
PP VBE but from Excel VBE I get "Run-time error 429: ActiveX comonent can't
create object"

PowerPoint.Application.ActiveWindow.Selection.Shap eRange.Name = "testname"

Through tools references I have selected:
VBA
MS XL 11.0 obj lib
OLE auto
MS off 11.0 obj lib
MS PP 11.0 obj lib
and just for kicks I tried some MS ActiveX object libraies, but they did not
seem to help so I have deselected them now. Any ideas?



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Code from Powerpoint VBE not Working in Excel VBE?

You need to declare a variable to represent the PowerPoint application:

Dim ppApp As PowerPoint.Application

Then you need to instantiate it in one of several ways. Assuming you have
Ppt running already:

Set ppApp = GetObject(, "PowerPoint.Application")

now adjust the line you posted:

ppApp.ActiveWindow.Selection.ShapeRange.Name = "testname"

Here's more on controlling one program from another:

http://peltiertech.com/Excel/XL_PPT.html

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


"Aaron" wrote in message
...
With a worksheet object selected in Powerpoint this code works perfectly
from
PP VBE but from Excel VBE I get "Run-time error 429: ActiveX comonent
can't
create object"

PowerPoint.Application.ActiveWindow.Selection.Shap eRange.Name = "testname"

Through tools references I have selected:
VBA
MS XL 11.0 obj lib
OLE auto
MS off 11.0 obj lib
MS PP 11.0 obj lib
and just for kicks I tried some MS ActiveX object libraies, but they did
not
seem to help so I have deselected them now. Any ideas?





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
VBA Excel code not working properly (HELP!) zulfer7 Excel Discussion (Misc queries) 3 April 5th 07 10:49 PM
Code not working in Excel 11 Mark Excel Programming 2 November 10th 06 12:21 PM
Open Powerpoint Presentation via Excel VBA code hurlbut777 Excel Programming 3 January 7th 05 12:42 AM
Excel 2000 code not working in XP Shane J Excel Programming 2 January 31st 04 03:40 AM
Need advice and code help with working with *.dbf files in Excel 97 TBA[_2_] Excel Programming 1 September 8th 03 09:14 AM


All times are GMT +1. The time now is 09:45 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"