Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Saving a ppt file with an Excel code (Office 200

    Hello,

    I have inherited the code for an add-in in Powerpoint which works in most of the parts except where the user clicks the button on saving the active presentation. My VBA knowledge is pretty limited, however from the code below I understood that it uses an Excel syntax to save the ppt file. I wonder is this at all possible? When I debug the code, it stops here:

    Do Until sPresoPath <> ""
    sPresoPathName = Excel.Application.GetSaveAsFilename _
    ("C:MyPathMy_Presentation.ppt", "Presentations (*.ppt), *.ppt", 1)

    Alternatively, is there another way to get access to the correct code for saving the ppt file?

    Thanks a lot in advance,
    Kislany

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Saving a ppt file with an Excel code (Office 200

    What exactly happens, do you get an error message?
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Saving a ppt file with an Excel code (Office 2

    Oups, sorry, I intended to post the error message, and I forgot.
    I get 'Run-time error '424'. Object required'

    Kislany

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Saving a ppt file with an Excel code (Office 2

    Which version(s) of PowerPoint does the code have to run on? I ask because Office XP/2002 introduced a new option for getting a file name.

  5. #5
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Saving a ppt file with an Excel code (Office 2

    I am trying to run the code in Office 2003 right now.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Saving a ppt file with an Excel code (Office 2

    You can use Application.FileDialog in PowerPoint 2002/2003:

    Dim sPresoPathName As String
    With Application.FileDialog(msoFileDialogSaveAs)
    .InitialFileName = "C:MyPathMy_Presentation.ppt"
    Do While sPresoPathName = ""
    If .Show = True Then
    sPresoPathName = .SelectedItems(1)
    End If
    Loop
    End With
    ' Example of use:
    MsgBox sPresoPathName

    Note: the user MUST supply a name. If the dialog is canceled, it is displayed again.

  7. #7
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Saving a ppt file with an Excel code (Office 2

    Thanks a lot for the code snippet, I will test it and let you know if I run into problems.

    Kislany

Posting Permissions

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