Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Get info from Powerpoint 2003


I am attempting to create a history log from PowerPoint 2003 to Excel
2003 using VBA.

Currently there are Daily Slides that are breifed to the boss. There
is a tedious process of manually copying the information from the
Powerpoint slides to an Excel Document, each colum for each day, for a
monthly history rollup report. The data in powerpoint is in an Excel
Chart, however when attempting to record a macro starting in excel or
powerpoint as a starting point, VBA will not open or close any
documents that is outside of the program that I am using, I am not an
expert, but I am also not a novice, but I am perplexed.

Essentially the end result would be once the powerpoint slides have
been updated to run a macro that copies only the necessary data, opens
the history rollup excel file, copies the data into the next
corresponding column, dates the top row, and then closes the excel
document.

I know this is probably more complicated than it sounds, however I have
been unsuccessful in even getting it started, because it seems as though
the two programs will not speak to each other.

Thank you in advance for any insight and ideas that you all may offer.


--
ordoff73
------------------------------------------------------------------------
ordoff73's Profile: http://www.excelforum.com/member.php...o&userid=22709
View this thread: http://www.excelforum.com/showthread...hreadid=536441

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Get info from Powerpoint 2003

This worked for me. Obviously it will take a little work on your part to
match your situation, but it should give you a start.

Create a Reference to Microsoft Powerpoint in your project in Excel. (In
the VBE, Tools=References, scroll to Microsoft Powerpoint and click the
checkbox). Then paste in this code in a new module.

to test this, create a single slide powerpoint presentation blank except for
a pasted excel range with data in B4:E17 (or). Save it and use that name in
the code.

Option Explicit
Sub AAA()
Dim ppt As PowerPoint.Application
Dim pres As PowerPoint.Presentation
Dim shp As PowerPoint.Shape
Dim oleObj As PowerPoint.OLEFormat
Dim bk As Excel.Workbook
Dim sh As Excel.Worksheet
Dim rng1 As Excel.Range
Dim rng As Excel.Range
Dim sVerb As Variant
Dim nCount As Long

Set ppt = New PowerPoint.Application
Set sh = ActiveSheet
Set rng1 = sh.Cells(1, Columns.Count).End(xlToLeft)(1, 2)
'Debug.Print ppt.Name, ppt.Presentations.Count
ppt.Visible = msoTrue
Set pres = ppt.Presentations.Open( _
Filename:="C:\Data\Excel_PPT.ppt", _
ReadOnly:=msoFalse)
For Each shp In pres.Slides(1).Shapes
If shp.Type = msoEmbeddedOLEObject Or _
shp.Type = msoLinkedOLEObject Then
Set oleObj = shp.OLEFormat
If TypeName(oleObj.Object) = "Workbook" Then
For Each sVerb In oleObj.ObjectVerbs
nCount = nCount + 1
Debug.Print nCount, sVerb
If sVerb = "Open" Then
' oleObj.DoVerb nCount
Set bk = oleObj.Object
Set rng = bk.Worksheets(1).Range("B4:E17")
rng.Copy Destination:=rng1
Set rng = Nothing
Set bk = Nothing
End If
Next
End If
End If
Next
Set oleObj = Nothing
Set shp = Nothing
pres.Close
Set pres = Nothing
ppt.Quit
Set ppt = Nothing
End Sub

--
Regards,
Tom Ogilvy


"ordoff73" wrote:


I am attempting to create a history log from PowerPoint 2003 to Excel
2003 using VBA.

Currently there are Daily Slides that are breifed to the boss. There
is a tedious process of manually copying the information from the
Powerpoint slides to an Excel Document, each colum for each day, for a
monthly history rollup report. The data in powerpoint is in an Excel
Chart, however when attempting to record a macro starting in excel or
powerpoint as a starting point, VBA will not open or close any
documents that is outside of the program that I am using, I am not an
expert, but I am also not a novice, but I am perplexed.

Essentially the end result would be once the powerpoint slides have
been updated to run a macro that copies only the necessary data, opens
the history rollup excel file, copies the data into the next
corresponding column, dates the top row, and then closes the excel
document.

I know this is probably more complicated than it sounds, however I have
been unsuccessful in even getting it started, because it seems as though
the two programs will not speak to each other.

Thank you in advance for any insight and ideas that you all may offer.


--
ordoff73
------------------------------------------------------------------------
ordoff73's Profile: http://www.excelforum.com/member.php...o&userid=22709
View this thread: http://www.excelforum.com/showthread...hreadid=536441


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Get info from Powerpoint 2003

If the data in your presentation is in an embeded Excel worksheet, then you
can write the code in the sheet's module and bypasss the automation issue all
together. You edit (double-clicking) the embeded worksheet, then execute the
macro.
--
Trent Argante


"ordoff73" wrote:


I am attempting to create a history log from PowerPoint 2003 to Excel
2003 using VBA.

Currently there are Daily Slides that are breifed to the boss. There
is a tedious process of manually copying the information from the
Powerpoint slides to an Excel Document, each colum for each day, for a
monthly history rollup report. The data in powerpoint is in an Excel
Chart, however when attempting to record a macro starting in excel or
powerpoint as a starting point, VBA will not open or close any
documents that is outside of the program that I am using, I am not an
expert, but I am also not a novice, but I am perplexed.

Essentially the end result would be once the powerpoint slides have
been updated to run a macro that copies only the necessary data, opens
the history rollup excel file, copies the data into the next
corresponding column, dates the top row, and then closes the excel
document.

I know this is probably more complicated than it sounds, however I have
been unsuccessful in even getting it started, because it seems as though
the two programs will not speak to each other.

Thank you in advance for any insight and ideas that you all may offer.


--
ordoff73
------------------------------------------------------------------------
ordoff73's Profile: http://www.excelforum.com/member.php...o&userid=22709
View this thread: http://www.excelforum.com/showthread...hreadid=536441


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
where do u get slides for microsoft powerpoint 2003? slides for microsoft powerpoint 2003 Excel Discussion (Misc queries) 2 October 16th 08 02:00 PM
Adding Excel charts to PowerPoint presentation in Office 2003 trooper665 Excel Programming 0 October 12th 05 05:03 PM
Can I lock info in Excel 2003 and users in Excel 2000 enter info? Mimmsan Excel Discussion (Misc queries) 1 September 8th 05 12:12 AM
not able to edit XL data in MS Powerpoint in office 2003 Sujay Excel Discussion (Misc queries) 2 May 31st 05 04:09 AM
ofice 2003 powerpoint does not print in landscape mode Baffled_Bill Excel Discussion (Misc queries) 2 January 15th 05 05:59 PM


All times are GMT +1. The time now is 10:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"