Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
where do u get slides for microsoft powerpoint 2003? | Excel Discussion (Misc queries) | |||
Adding Excel charts to PowerPoint presentation in Office 2003 | Excel Programming | |||
Can I lock info in Excel 2003 and users in Excel 2000 enter info? | Excel Discussion (Misc queries) | |||
not able to edit XL data in MS Powerpoint in office 2003 | Excel Discussion (Misc queries) | |||
ofice 2003 powerpoint does not print in landscape mode | Excel Discussion (Misc queries) |