Open Excel from PowerPoint

mingyi

New Member
Joined
Feb 18, 2004
Messages
7
Hi,
I'm having trouble opening a particular worksheet from PowerPoint. I can open the Workbook fine, but I can't open a particular worksheet that I want. Can anyone help?
Dim tempname, pptname, refbox As String

tempname = ActivePresentation.name
i = Strings.Len(tempname)
pptname = Strings.Left(tempname, i - 4)


Set xlsApp = CreateObject("Excel.Application")
xlsApp.Visible = True
Dim path As String

path = "S:\SHARE\drf\Automation\Index\Indexsheet.xls"

Set newxls = xlsApp.Workbooks.Open(path)
Worksheets(pptname).Activate

Thank you!
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Change...
Code:
Worksheets(pptname).Activate
To this...
Code:
newxls.Sheets(pptname).Activate
 
Upvote 0
Thank you for your help! I needed to play around a bit with the sheetname, but it works now!
 
Upvote 0

Forum statistics

Threads
1,225,360
Messages
6,184,505
Members
453,236
Latest member
Siams

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top