Note:
As of version 6 and above, these features are deprecated. Support will no longer be provided.
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. You will need to adapt these examples to your use case.
To update links
In PPT, update all shapes in a given slide
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, update all inlines shapes in document
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
Dim pos As Integer
pos = InStr(oShp.AlternativeText, "#UpSlideImport#")
If pos <> 0 Then
upSlide.UpdateLinksInSelection
End If
End If
Next lngIndex
End Sub
In Word, update all text in document
Sub UpdateTextLinks()
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 oField As Word.field
Dim lngIndex As Long
For lngIndex = ActiveDocument.Fields.Count To 1 Step -1
Set oField = ActiveDocument.Fields.Item(lngIndex)
If IsUpSlideField(oField) Then
oField.Result.Select
upSlide.UpdateLinksInSelection
End If
Next lngIndex
End Sub
Function IsUpSlideField(field As field) As Boolean
IsUpSlideField = GetVariableName(field) = "UpSlideExportField"
End Function
Function GetVariableName(field As field) As String
If field Is Nothing Then
GetVariableName = ""
Exit Function
End If
If field.Type <> WdFieldType.wdFieldDocVariable Then
GetVariableName = ""
Exit Function
End If
Dim codeRange As Range
Set codeRange = field.code
Dim code As String
code = codeRange.Text
If code = "" Then
GetVariableName = ""
Exit Function
End If
Dim splits() As String
splits = Split(code, """")
If UBound(splits, 1) <= 1 Then
GetVariableName = ""
Else
GetVariableName = splits(1)
End If
End Function
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