Consulting

Results 1 to 2 of 2

Thread: Solved: VBA Compiler Problems

  1. #1

    Solved: VBA Compiler Problems

    Dear all


    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?

    [VBA]

    '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

    [/VBA]


  2. #2

    Problem solved

    Never mind, it is sorted...I will mark it solved, feel a little silly now

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •