PDA

View Full Version : Solved: VBA Compiler Problems



samuelwright
12-06-2005, 07:28 AM
Dear all :hi:


I am trying to save a presentation with this code in it as an Add In. Whenever I do Save As, a message box pops up saying that PowerPoint cannot compile the Visual Basic Code (no reason is given why of course). Can anyone replicate the problem? If so, can anyone offer any help?



'There is a form called SubjectNameForm associated with this procedure.
'The form contains a web browser window linking to a intranet based
'taxonomy for keywords and several comboboxes, Text boxes and radio
'buttons and basically outputs a string which
'is transposed to the Save As Dialog Box, and also writes into the
'BuiltInDocumentProperties of the presentation

Option Explicit

Sub Auto_Open()
BuildToolBar
End Sub

Sub Auto_Close()
DeleteToolbar
End Sub

Sub BuildToolBar()
Dim cb As CommandBarControl

With Application.CommandBars("Menu Bar")
Set cb = .Controls.Add(msoControlPopup)
With cb
.Caption = "Load Form"
.OnAction = "FOI"
End With
End With
End Sub

Sub DeleteToolbar()
Dim cb As CommandBarControl

For Each cb In Application.CommandBars("Menu Bar").Controls
If cb.Caption = "RAF Save" Then cb.Delete
Next
End Sub

Sub FOI()

If Application.Presentations.Count > 0 Then
Load SubjectNameForm
SubjectNameForm.Show
Else
MsgBox "Nothing to save"
End If

End Sub



:dunno

samuelwright
12-08-2005, 04:07 AM
Never mind, it is sorted...I will mark it solved, feel a little silly now:hide: