Through the SlideFab API it is possible to invoke the slide making automation from using VBA. This creates new possibilities, e.g. when SlideFab 2 is run through your VBA-based Excel add-in. SlideFab will run in a silent mode with no user interaction required such that there is a seamless integration possible.
It is important here that only the Slide Making mechanism is available in the API. Setting up the automation with the iteration loops, links between Excel and Powerpoint, etc., needs to be set upfront using the SlideFab 2 interface as always. Also the license key needs to be set up if SlideFab 2 is run as flex or saver instead of lite.
Just a few lines of code are required to invoke SlideFab. The following method works in Excel, for example. It creates a Powerpoint application object and retrieves the SlideFab 2 add-in from it. The slide automation is invoked through the API with the method MakeSlidesFromWb
.
Sub InvokeSlideFabMakeSlides()
Dim addIn As COMAddIn
Dim automationObject As Object
Dim pptApp As Object
Set pptApp = CreateObject("PowerPoint.Application")
Set addIn = pptApp.COMAddIns("HuehnSolutions.SlideFab2")
Set automationObject = addIn.Object
automationObject.MakeSlidesFromWb pptInputPath:="SomeTemplate.pptx", _
wb:=ThisWorkbook, _
pptOutputPath:="SomeOutput.pptx"
pptApp.Quit
End Sub
The method MakeSlidesFromWb
requires three parameters:
pptInputPath as String
: The relative or absolute path to the Powerpoint template presentationwb as Excel.Workbook
: A reference to an existing Excel workbookpptOutputPath as String
: The relative or absolute path where the created slides shall be written to
SlideFab 2 Manual Outline
- Documentation
- Think twice before coding VBA from Excel to PowerPoint
- Quickstart to SlideFab 2
- How SlideFab 2 works
- Requirements for SlideFab 2
- The SlideFab 2 ribbon
- Creating think-cell charts with SlideFab 2 automatically
- Invoking slide automation from your own code using VBA and the SlideFab 2 API
- Best practice