Starting with version 4.4.1.0, you can call some of UpSlide's features directly from a VBA macro.
Features
The following features are available in Excel:
- Create custom charts such as Waterfall or Marimekko
- Update custom charts
- Smart Format
- Export to PowerPoint or Word
The following features are available in PowerPoint and Word:
- Update UpSlide link
Application | Feature | Method signature |
Excel | Create custom charts | CreateChart(Type)* |
Excel | Update custom charts | UpdateUpslideCharts() |
Excel | Smart Format | SmartFormatSelection() |
Excel | Export to PowerPoint | ExportSelectionToPowerPoint() |
Excel | Export to Word | ExportSelectionToWord() |
PowerPoint | Update UpSlide link | UpdateLinksInSelection() |
Word | Update UpSlide link | UpdateLinksInSelection() |
The argument Type can take the following values:
- Waterfall: Type = 1
- Marimekko (Value): Type = 2
- Marimekko (%): Type = 3
- Stacked Waterfall: Type = 4
Examples
Below are examples of how you would typically call an exposed UpSlide method from your VBA code:
To update links
In PPT
Option Explicit
Public Sub UpdateShapesInPPT()
Dim ppApp As New PowerPoint.Application
Dim pp As PowerPoint.Presentation
Dim pptSlide As Slide
Dim upSlide As Object
Set pp = ppApp.Presentations.Open(filename)
Set pptSlide = pp.Slides(9)
pptSlide.Select
pptSlide.Shapes.SelectAll
Set upSlide = ppApp.COMAddIns("Finance3point1.UpSlide.PowerPoint").Object
If upSlide Is Nothing Then
MsgBox "Cannot connect to the UpSlide Addin.", vbInformation + vbOKOnly, "UpSlide"
Exit Sub
End If
UpSlide.UpdateLinksInSelection
End Sub
In Word
Sub UpdateShapesInWord()
Set wdApp = GetObject(, "Word.Application")
Set upSlide = wdApp.COMAddIns("Finance3point1.UpSlide.Word").Object
If upSlide Is Nothing Then
MsgBox "Cannot connect to the UpSlide Addin.", vbInformation + vbOKOnly, "UpSlide"
Exit Sub
End If
Dim oShp As Word.InlineShape
Dim lngIndex As Long
For lngIndex = ActiveDocument.InlineShapes.Count To 1 Step -1
Set oShp = ActiveDocument.Range.InlineShapes(lngIndex)
oShp.Select
If oShp.AlternativeText <> "" Then
upSlide.UpdateLinksInSelection
End If
Next lngIndex
End Sub
To create a Chart
Option Explicit
Private Enum ChartType
Waterfall = 1
Marimekko = 2
MarimekkoPercent = 3
StackedWaterfall = 4
End Enum
Private Function UpSlideAddin() As Object
Set UpSlideAddin = Application.COMAddIns("Finance3point1.UpSlide.Excel").Object
End Function
Public Sub InsertWaterfall()
Dim upSlide As Object
Set upSlide = UpSlideAddin()
If upSlide Is Nothing Then
MsgBox "Cannot connect to the UpSlide Addin.", vbInformation + vbOKOnly, "UpSlide"
Exit Sub
End If
upSlide.CreateChart ChartType.Waterfall
End Sub