473,398 Members | 2,389 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Open Powerpoint from Excel

3
Hi Everyone - I am running XP (VB 6.3) and am having a problem opening Powerpoint from an option button that is located in a Userform.
The code I'm trying worked with windows 2000, but not XP.

MyAppID = Shell("C:\Program Files\Microsoft Office\OFFICE11\POWERPNT.EXE ""

Can anyone please point me in the right direction.

Thank you so much
Sep 12 '06 #1
2 6665
Hi Everyone - I am running XP (VB 6.3) and am having a problem opening Powerpoint from an option button that is located in a Userform.
The code I'm trying worked with windows 2000, but not XP.

MyAppID = Shell("C:\Program Files\Microsoft Office\OFFICE11\POWERPNT.EXE ""

Can anyone please point me in the right direction.

Thank you so much
Hi TKrc,

I see you want to open PowerPoint with a shell command. Why don't you open it whitin VB. If you put this code behind your Button it will start and begins a presentation(with PowerPoint)


Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Sub Command1_Click()
' Start PowerPoint.
Dim ppApp As PowerPoint.Application
Set ppApp = CreateObject("Powerpoint.Application")

' Maak de toepassing zichtbaar.
ppApp.Visible = True

' Voeg een nieuwe presentatie toe.
Dim ppPres As PowerPoint.Presentation
'Set ppPres = ppApp.Presentations.Add(msoTrue)
' Voeg een nieuwe dia toe.
Dim ppSlide1 As PowerPoint.Slide
Set ppSlide1 = ppPres.Slides.Add(1, ppLayoutText)

' Voeg wat tekst toe.
ppSlide1.Shapes(1).TextFrame.TextRange.Text = "Mijn eerste dia"
ppSlide1.Shapes(2).TextFrame.TextRange.Text = "PowerPoint automatiseren is een makkie" & vbCr & "Werken met Visual Basic is cool!"

' Voeg nog een dia toe, met een diagram.
Dim ppSlide2 As PowerPoint.Slide
Set ppSlide2 = ppPres.Slides.Add(2, ppLayoutTextAndChart)

' Voeg wat tekst toe.
ppSlide2.Shapes(1).TextFrame.TextRange.Text = "Slide 2's topic"
ppSlide2.Shapes(2).TextFrame.TextRange.Text = "U kunt in uw PowerPoint-dia's diagrammen maken en gebruiken!"

' Voeg een diagram toe op dezelfde locatie als het vorige diagram.
Dim cTop As Double
Dim cWidth As Double
Dim cHeight As Double
Dim cLeft As Double
With ppSlide2.Shapes(3)
cTop = .Top
cWidth = .Width
cHeight = .Height
cLeft = .Left
.Delete
End With
ppSlide2.Shapes.AddOLEObject cLeft, cTop, cWidth, cHeight, "MSGraph.Chart"

' Voeg nog een dia toe, met een organigram.
Dim ppSlide3 As PowerPoint.Slide
Set ppSlide3 = ppPres.Slides.Add(3, ppLayoutOrgchart)

' Voeg wat tekst toe.

ppSlide3.Shapes(1).TextFrame.TextRange.Text = "De rest wordt alleen beperkt door uw verbeelding"

' Voeg een organigram toe op dezelfde locatie als het vorige organigram.
With ppSlide3.Shapes(2)
cTop = .Top
cWidth = .Width
cHeight = .Height
cLeft = .Left
.Delete
End With
' ppSlide3.Shapes.AddOLEObject cLeft, cTop, cWidth, cHeight, "OrgPlusWOPX.4" 'OrgPlusWOPX.4
' is een object van Microsoft Organigram


' Stel eigenschappen van de diavoorstelling in.
With ppPres.Slides.Range.SlideShowTransition
.EntryEffect = ppEffectRandom
.AdvanceOnTime = msoTrue
.AdvanceTime = 5 ' 5 seconds per slide
End With

' Bereid de diavoorstelling voor en voer deze uit.
With ppPres.SlideShowSettings
.ShowType = ppShowTypeKiosk
.LoopUntilStopped = msoTrue

.RangeType = ppShowAll
.AdvanceMode = ppSlideShowUseSlideTimings
.Run
End With

' Slaapstand inschakelen, zodat gebruiker diavoorstelling kan bekijken.
Sleep (15000)

' Opschonen.
ppApp.Quit

End Sub
Sep 13 '06 #2
TKrc
3
Thank you so much for your reply. Not sure if it is exactly what i'm looking for.

What I'm trying to do is open a specific powerpoint file from an option button, then close the powerpoint file and have my CustomMenu reappear. My CustomMenu would be the toolbox and i want to be able to pull either excel or powerpoint files up, make revisions, save and close. After closing any file, i want the CustomMenu to reappear. I have the excel files working properly, but having a little trouble with both Powerpoint and email.

Any other suggestions would be much appreciated.

thanks again
Sep 15 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Belinda | last post by:
Hello All I want to place a Excel workbook on the web server and create a URL link to it and when the user clicks on it to the URL/vbscript behind it must launch Excel on the client and open the...
0
by: Ata | last post by:
Hello, I am trying to copy the contents of the output of SQL Reporting Services to a PowerPoint slide. For this, I am using SQL Reporting Services to obtain an IMAGE stream, which I paste to the...
6
by: C Williams | last post by:
Hi, I am writing some VB.NET code that compiles to a dll. There is some code within it that manipulates Powerpoint 2003. The dll I am writing is for smart tags, and I am having trouble...
4
by: Jenni | last post by:
Hi, A quick question. I have been battling with this code all morning, please help. Here is the code Dim fPath1 As String Dim fPath2 As String fPath1 = "C:\Program Files\Microsoft...
4
by: Joseph | last post by:
I am trying to open a 3 powerpoint presentation simultaneously afte each other without interruption, the operator of the application doe not need to notice anything or interfere in the operation of...
2
by: Jonathan Trevor | last post by:
Hi, For the last couple of releases of a product we're developing we've been running to very wierd behavior from IE and our ASP.NET web application which serves up various types of files and I'm...
0
by: Rach | last post by:
Hi, Does anyone know how to export charts/graphs from EXCEl into Powerpoint-Microsoft Charts though VBA code. I would like to import the underlying data with the chart as well. I know we can...
1
by: psuaudi | last post by:
I’m using a vb.net app that opens a powerpoint presentation and calls the updatelinks function of powerpoint. One slide in the presentation is linked to a cell range in an excel file, and the...
0
by: DLN | last post by:
Does anyone know how to Open Excel and have it Jump to a Cell given in the command line. Example: I have a PowerPoint Slide with 7 Bars and when you Click on Bar 1 it opens ExcelFile and jumps to...
2
by: LucasLondon | last post by:
Hi, I'm trying to use VBA to extract underlying data from charts in powerpoint to excel, i.e from the underlying powerpoint datasheet that feeds the chart. I've found the macro below on the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.