Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Running a CommandButton in Excel I get this error

When I try to open Powerpoint using a commandbutton I get
a "Run-Time Error". Here's
the Code. Can someone help me with this, Thanks:


Private Sub CommandButton1_Click()
callppt

End Sub

Sub callppt()
x = Shell("C:\Program Files\Microsoft
Office\Office\POWERPNT.EXE")

Dim pptApp As Object
Set pptApp = CreateObject("Powerpoint.Application")
pptApp.Visible = True
pptApp.Presentations.Open
Filename:="U\DATA\POWER\Learning.ppt"




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Running a CommandButton in Excel I get this error

Is the code exactly as you show it, as we are getting wrap around.

Try this alternative

Private Sub CommandButton1_Click()
callppt

End Sub

Sub callppt()
Dim pptApp As Object
Set pptApp = CreateObject("Powerpoint.Application")
pptApp.Visible = True
pptApp.Presentations.Open _
Filename:="U\DATA\POWER\Learning.ppt"

I have lost the shell command as it seems totally superfluous.



--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Bert" wrote in message
...
When I try to open Powerpoint using a commandbutton I get
a "Run-Time Error". Here's
the Code. Can someone help me with this, Thanks:


Private Sub CommandButton1_Click()
callppt

End Sub

Sub callppt()
x = Shell("C:\Program Files\Microsoft
Office\Office\POWERPNT.EXE")

Dim pptApp As Object
Set pptApp = CreateObject("Powerpoint.Application")
pptApp.Visible = True
pptApp.Presentations.Open
Filename:="U\DATA\POWER\Learning.ppt"






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Running a CommandButton in Excel I get this error

I put in the code as you suggested and I still get Run
Time Error which says the "PowerPoint Can not open the
File" Do you know why this is happening?


-----Original Message-----
Is the code exactly as you show it, as we are getting

wrap around.

Try this alternative

Private Sub CommandButton1_Click()
callppt

End Sub

Sub callppt()
Dim pptApp As Object
Set pptApp = CreateObject("Powerpoint.Application")
pptApp.Visible = True
pptApp.Presentations.Open _
Filename:="U\DATA\POWER\Learning.ppt"

I have lost the shell command as it seems totally

superfluous.



--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Bert" wrote in

message
...
When I try to open Powerpoint using a commandbutton I

get
a "Run-Time Error". Here's
the Code. Can someone help me with this, Thanks:


Private Sub CommandButton1_Click()
callppt

End Sub

Sub callppt()
x = Shell("C:\Program Files\Microsoft
Office\Office\POWERPNT.EXE")

Dim pptApp As Object
Set pptApp = CreateObject("Powerpoint.Application")
pptApp.Visible = True
pptApp.Presentations.Open
Filename:="U\DATA\POWER\Learning.ppt"






.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Running a CommandButton in Excel I get this error

Well that presumably means that the file does not exist.

When I tried it with a file that did exits, it worked fine.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Bert" wrote in message
...
I put in the code as you suggested and I still get Run
Time Error which says the "PowerPoint Can not open the
File" Do you know why this is happening?


-----Original Message-----
Is the code exactly as you show it, as we are getting

wrap around.

Try this alternative

Private Sub CommandButton1_Click()
callppt

End Sub

Sub callppt()
Dim pptApp As Object
Set pptApp = CreateObject("Powerpoint.Application")
pptApp.Visible = True
pptApp.Presentations.Open _
Filename:="U\DATA\POWER\Learning.ppt"

I have lost the shell command as it seems totally

superfluous.



--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Bert" wrote in

message
...
When I try to open Powerpoint using a commandbutton I

get
a "Run-Time Error". Here's
the Code. Can someone help me with this, Thanks:


Private Sub CommandButton1_Click()
callppt

End Sub

Sub callppt()
x = Shell("C:\Program Files\Microsoft
Office\Office\POWERPNT.EXE")

Dim pptApp As Object
Set pptApp = CreateObject("Powerpoint.Application")
pptApp.Visible = True
pptApp.Presentations.Open
Filename:="U\DATA\POWER\Learning.ppt"






.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Running a CommandButton in Excel I get this error



Thanks,

I got it to work!!!



-----Original Message-----
Well that presumably means that the file does not exist.

When I tried it with a file that did exits, it worked

fine.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Bert" wrote in

message
...
I put in the code as you suggested and I still get Run
Time Error which says the "PowerPoint Can not open the
File" Do you know why this is happening?


-----Original Message-----
Is the code exactly as you show it, as we are getting

wrap around.

Try this alternative

Private Sub CommandButton1_Click()
callppt

End Sub

Sub callppt()
Dim pptApp As Object
Set pptApp = CreateObject("Powerpoint.Application")
pptApp.Visible = True
pptApp.Presentations.Open _
Filename:="U\DATA\POWER\Learning.ppt"

I have lost the shell command as it seems totally

superfluous.



--

HTH

Bob Phillips
... looking out across Poole Harbour to the

Purbecks
(remove nothere from the email address if mailing

direct)

"Bert" wrote in

message
...
When I try to open Powerpoint using a commandbutton I

get
a "Run-Time Error". Here's
the Code. Can someone help me with this, Thanks:


Private Sub CommandButton1_Click()
callppt

End Sub

Sub callppt()
x = Shell("C:\Program Files\Microsoft
Office\Office\POWERPNT.EXE")

Dim pptApp As Object
Set pptApp = CreateObject("Powerpoint.Application")
pptApp.Visible = True
pptApp.Presentations.Open
Filename:="U\DATA\POWER\Learning.ppt"






.



.

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
Error message When running Macros on MS excel 2002 Kosmos2040 Excel Programming 2 April 30th 04 05:56 PM
Error when running macro in Excel Raphael Saddy Excel Programming 4 April 12th 04 09:09 PM
Run-time error '1004' running to excel objects at once Dianna Braden Excel Programming 0 October 16th 03 08:55 PM
Automation error running an excel add-in Edison Wong Excel Programming 0 September 25th 03 06:44 PM
KERNEL32.DLL error after running EXCEL Macro Dan[_16_] Excel Programming 0 July 23rd 03 08:15 PM


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