Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Trouble opening embedded Excel in PPT

(I wrongly posted this in an incorrect forum)
Hi All,
I need to programmatically manipulate embedded excel objects in PPT.
I've put a macro together, but I am not able to get the macro to open the
embedded excel object (excel comes up blank). Can someone please tell me
what's wrong?
Thanks in advance, JS
=======================================
Sub a_Open_EmbeddedExcel()
Dim Shp As Shape
Dim Sld As Slide
Dim xlApp As Excel.Application
Dim oWorkbook As Excel.Workbook
Dim oWorksheet As Excel.Worksheet
Set xlApp = New Excel.Application
For Each Sld In Application.ActivePresentation.Slides
For Each Shp In Sld.Shapes
If Shp.Type = msoEmbeddedOLEObject Then
If Shp.OLEFormat.ProgID = "Excel.Sheet.8" Then
Set oWorkbook = Shp.OLEFormat.Object
Set oWorksheet = oWorkbook.ActiveSheet
With xlApp
.Visible = True
oWorksheet.Activate
MsgBox "Did it open the embedded excel object?"
MsgBox "There are " & xlApp.Windows(1).VisibleRange.Cells.Count & "
cells visible"
' if yes,
' MsgBox xlApp.ActiveWindow.VisibleRange.Address
' more excel macro commands here
End With
oWorkbook.Close (True)
Set oWorkbook = Nothing
Set oWorksheet = Nothing
End If 'Shp.Type
End If 'Shp.OLEFormat.ProgID
Next Shp
Next Sld
xlApp.Quit
End Sub



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
Trouble opening xls attachments with my Excel 2000 dakkumar Excel Discussion (Misc queries) 1 March 4th 10 01:20 PM
Opening an embedded object in Excel 2007 Barbara B Excel Discussion (Misc queries) 0 June 25th 09 09:35 PM
trouble opening excel documents JDD1 Excel Discussion (Misc queries) 3 March 8th 08 01:23 AM
Excel 2000 - Trouble Opening File pbuc0109 Excel Discussion (Misc queries) 1 March 2nd 07 06:20 AM
Trouble opening excel file weimar Excel Discussion (Misc queries) 2 March 7th 06 05:07 PM


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