I'm currently considering a number of options for copying an excel sheet into a powerpoint presentation.
- Using VBA select a excel sheet, copy the range and place it into a newly created powerpoint slide as an image.
- I create excel automated html of a sheet, once that html is saved(initially), i create an image off of the html.
- Using VSTO, i open Excel copy each object and paste it into a new powerpoint slide, using the clipboard(or another copy method).
These operations will be called frequently, by many different users - all the actual operation occurs on a singl开发者_Python百科e server.
What would the pros and cons of each approach be? Are there any prefered or better optimized techniques available?
Option 1:
Pro:
- Speed
Contra:
- The inserted Data can't be copied, altered, viewed within excel etc.
Option 3:
A couple of years ago I wrote a similar VBA-Procedure that created a >1000 Slides Presentation from an Excel Sheet. The method was called from Excel and went AFAIR like this(pseudo-code):
newSlide = PowerPoint.AddSlide
embeddedSheet = newSlide.Add OLEObject(Excel-Sheet)
embeddedSheet.Range(..., ...) = srcSheet.Range(..., ...)
someFormating(embeddedSheet)
createPieChart(embeddedSheet.Range(..,...))
resize(embeddedSheet)
embeddedSheet.Save
embeddedSheet.Close
Pro / Contra based on my experience with the method above.
Pro:
- The Sheet is embedded in PowerPoint
- you can alter the Data and run Macros on it.
- you do not need to keep the original Excel sheet.
Contra:
- The Output-File is bigger
- The Process uses a lot of RAM.
- The Process takes relatively long. AFAIR 1k Slides took about 10 Minutes on the computer in my office. Creating the OleObject took the majority of the time.
精彩评论