|
-
Mar 30th, 2005, 04:30 PM
#1
Thread Starter
Member
Help in linking multiple worksheets from a single Excel file to powepoint.
Guys,
I am writing a macro in powerpoint to link a excel sheet using AddOLEObject..My code is..
ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject(Left:=120#, Top:=110#, Width:=480#, Height:=320#, FileName:="C:testexcel.xls", Link:=msoTrue).Select
This works fine for me..
But I have multiple worksheet in the "testexcel.xls" file and I want to link all the worksheets into powerpoint slides one by one.
Any idea of how to do this ?
Note: Even if it can be accomplished without writing a macro also appreciated(design time).
Thanks for your help..
Kandan.
-
Mar 30th, 2005, 11:22 PM
#2
Re: Help in linking multiple worksheets from a single Excel file to powepoint.
When you do an AddOLEObject it takes the first sheet as turns it into an image.
There is no way to navigate to the other sheets. The only thing you can do is have one sheet per workbook
and add them indivdually.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 31st, 2005, 08:57 AM
#3
Thread Starter
Member
Re: Help in linking multiple worksheets from a single Excel file to powepoint.
Thanks for the information..
btw, Is there any other way other than AddOleObject where I can link multiple sheets in a excel sheet.
Thanks again,
Kandan.
-
Mar 31st, 2005, 11:32 PM
#4
Re: Help in linking multiple worksheets from a single Excel file to powepoint.
Ok, its a bit messy but for now this should work.
VB Code:
ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject(Left:=120, Top:=110, Width:=480, Height:=320, _
FileName:="C:\Documents and Settings\VB-Guru\My Documents\Book1.xls", Link:=msoTrue).Select
With ActiveWindow.Selection.ShapeRange
.Left = 311.625
.Top = 256.875
.Width = 96.75
.Height = 26.25
End With
'ToDo:
'Open the Excel workbook
'Change the active tab and save the workbook
'Close the workbook or close it and the end only?
'Done:
'Refresh the link.
ActiveWindow.Selection.ShapeRange.OLEFormat.DoVerb Index:=1
Seems that when you save the workbook with a diffeent sheet as the active tab, when you insert
the workbook to PP it will take a snaposhot of the active sheet only. So my thinking was if you can switch the active
sheet and refresh the link between slides.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|