Skip to content

API: How to run SlideFab 2 from e.g. Excel via VBA

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, _
End Sub

The method MakeSlidesFromWb requires three parameters:

  1. pptInputPath as String: The relative or absolute path to the Powerpoint template presentation
  2. wb as Excel.Workbook: A reference to an existing Excel workbook
  3. pptOutputPath as String: The relative or absolute path where the created slides shall be written to

SlideFab 2 Manual Outline