JackMDaniels
New Member
- Joined
- Feb 10, 2014
- Messages
- 24
Hi All
I'm having a problem running a macro I had made, it was initially made for a different PowerPoint Document but I've dropped new content in and I'm getting this error, if anyone could shed some light with a resolution I'd be eternally grateful
http://imgur.com/y95XQsp
http://imgur.com/C5zJzx6
I'm having a problem running a macro I had made, it was initially made for a different PowerPoint Document but I've dropped new content in and I'm getting this error, if anyone could shed some light with a resolution I'd be eternally grateful
Code:
Option Explicit
Private Sub CmdAdd_Click()
Dim SldM As Master
Dim Sld As Slide
Dim LngCounter As Long
Set Sld = ActivePresentation.Slides("Slide90")
Sld.Shapes(5).Table.Cell(1, 2).Shape.TextFrame.TextRange.Text = Me.txtVersion & "/" & Me.txtStatus
Sld.Shapes(5).Table.Cell(2, 2).Shape.TextFrame.TextRange.Text = Me.txtDate
Sld.Shapes(5).Table.Cell(3, 2).Shape.TextFrame.TextRange.Text = Me.txtOwner
Sld.Shapes(5).Table.Cell(4, 2).Shape.TextFrame.TextRange.Text = Me.txtCreator
Sld.Shapes(5).Table.Cell(5, 2).Shape.TextFrame.TextRange.Text = Me.txtFunction
Sld.Shapes(5).Table.Cell(6, 2).Shape.TextFrame.TextRange.Text = Me.txtApprover
Sld.Shapes(5).Table.Cell(7, 2).Shape.TextFrame.TextRange.Text = Me.txtDocID
Sld.Shapes(5).Table.Cell(8, 2).Shape.TextFrame.TextRange.Text = Me.txtDocLocation
Set Sld = Nothing
Set SldM = ActivePresentation.Designs(1).SlideMaster
SldM.Shapes(26).TextFrame.TextRange.Text = "Copyright 2014 Nokia - " & Me.txtFileName & " - v." & Me.txtVersion & " - " & Me.txtCreator & " - " & Me.txtDocID
SldM.Shapes(28).TextFrame.TextRange.Text = Me.cmbClassification
Set SldM = Nothing
Set SldM = ActivePresentation.Designs(2).SlideMaster
SldM.Shapes(25).TextFrame.TextRange.Text = "Copyright 2014 Nokia - " & Me.txtFileName & " - v." & Me.txtVersion & " - " & Me.txtCreator & " - " & Me.txtDocID
SldM.Shapes(26).TextFrame.TextRange.Text = Me.cmbClassification
Set SldM = Nothing
If CLng(Application.Version = 11) Then
For LngCounter = 3 To 6
Set SldM = ActivePresentation.Designs(LngCounter).SlideMaster
SldM.Shapes(23).TextFrame.TextRange.Text = "Copyright 2014 Nokia - " & Me.txtFileName & " - v." & Me.txtVersion & " - " & Me.txtCreator & " - " & Me.txtDocID
SldM.Shapes(24).TextFrame.TextRange.Text = Me.cmbClassification
Set SldM = Nothing
DoEvents
Next
End If
MsgBox "Metadata slide updated", vbOKOnly + vbInformation, "Nokia"
Unload Me
End Sub
Private Sub UserForm_Activate()
Dim Sld As Slide
Dim SldM As Master
Dim StrContainer As String
With cmbClassification
.AddItem " ", 0
.AddItem "Public", 1
.AddItem "For internal use", 2
.AddItem "Confidential", 3
.AddItem "Secret", 4
End With
Set Sld = ActivePresentation.Slides("Slide90")
[COLOR=#ff0000] StrContainer = Sld.Shapes(5).Table.Cell(1, 2).Shape.TextFrame.TextRange.Text[/COLOR]
If InStr(1, StrContainer, "/") <> 0 Then
Me.txtVersion = Trim(Left(StrContainer, InStr(1, StrContainer, "/") - 1))
Me.txtStatus = Trim(Right(StrContainer, Len(StrContainer) - InStr(1, StrContainer, "/")))
End If
Me.txtDate = Sld.Shapes(5).Table.Cell(2, 2).Shape.TextFrame.TextRange.Text
Me.txtOwner = Sld.Shapes(5).Table.Cell(3, 2).Shape.TextFrame.TextRange.Text
Me.txtCreator = Sld.Shapes(5).Table.Cell(4, 2).Shape.TextFrame.TextRange.Text
Me.txtFunction = Sld.Shapes(5).Table.Cell(5, 2).Shape.TextFrame.TextRange.Text
Me.txtApprover = Sld.Shapes(5).Table.Cell(6, 2).Shape.TextFrame.TextRange.Text
Me.txtDocID = Sld.Shapes(5).Table.Cell(7, 2).Shape.TextFrame.TextRange.Text
Me.txtDocLocation = Sld.Shapes(5).Table.Cell(8, 2).Shape.TextFrame.TextRange.Text
Set Sld = Nothing
Set SldM = ActivePresentation.SlideMaster
StrContainer = SldM.Shapes(26).TextFrame.TextRange.Text
StrContainer = Right(StrContainer, Len(StrContainer) - 23)
If InStr(1, StrContainer, " - v.") > 5 Then
Me.txtFileName = Trim(Left(StrContainer, InStr(1, StrContainer, " - v.") - 1))
End If
Me.cmbClassification = SldM.Shapes(28).TextFrame.TextRange.Text
Set SldM = Nothing
End Sub
http://imgur.com/y95XQsp
http://imgur.com/C5zJzx6
Last edited: