+ Reply to Thread
Results 1 to 2 of 2

open powerpoint file

  1. #1
    raph_baril
    Guest

    open powerpoint file

    I want to open a power point file with the following code but it's always
    giving me an error on the last line. Somebody knows?

    Sub openppt()

    Dim Brocoli As Object
    Dim Potato As Object
    Dim carot As String

    carot = "C:\random folder\open me.ppt"

    Set Brocoli = CreateObject("powerpoint.Application")
    Brocoli.Visible = True

    Set Potato = Brocoli.documents.Open(Filename:=carot)

    End Sub

  2. #2
    raph_baril
    Guest

    Re: open powerpoint file

    Yes I made it up, it works perfectly when you replace "document" by
    "presentations"
    Thanks!!!

    "Chip Pearson" wrote:

    > The PowerPoint object model doesn't have a Documents object. Did
    > you just make it up? Try
    >
    > Set Potato = Brocoli.Presentations.Open(filename:=carot)
    >
    >
    > --
    > Cordially,
    > Chip Pearson
    > Microsoft MVP - Excel
    > Pearson Software Consulting, LLC
    > www.cpearson.com
    >
    >
    >
    >
    > "raph_baril" <[email protected]> wrote in
    > message
    > news:[email protected]...
    > >I want to open a power point file with the following code but
    > >it's always
    > > giving me an error on the last line. Somebody knows?
    > >
    > > Sub openppt()
    > >
    > > Dim Brocoli As Object
    > > Dim Potato As Object
    > > Dim carot As String
    > >
    > > carot = "C:\random folder\open me.ppt"
    > >
    > > Set Brocoli = CreateObject("powerpoint.Application")
    > > Brocoli.Visible = True
    > >
    > > Set Potato = Brocoli.documents.Open(Filename:=carot)
    > >
    > > End Sub

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1