+ Reply to Thread
Results 1 to 3 of 3

Thread: error when use getobject()

  1. #1
    Registered User
    Join Date
    11-12-2009
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    9

    error when use getobject()

    Dear all,

    I hit error message "filename or class name not found during automation operation" in the following codes in the Getobject().. any idea what i have miss?

    FYI, i am using microsoft powerpoint 11.0 object library

    Function code1()
    
    Dim PPApp As PowerPoint.Application
    Dim PPPres As PowerPoint.Presentation
    Dim PPSlide As PowerPoint.Slide
    Dim PresentationFileName As Variant
    Dim SlideCount As Long
    Dim iCht As Integer
    
    PresentationFileName = ThisWorkbook.Path + "\dashboard_" & Format(Date, "ddmmyy" & ".ppt")
    
    
    
    '''''''''''''''''''''''''''''hit error here....
    Set PPApp = GetObject(PresentationFileName, "Powerpoint.Application")
    
    .......

  2. #2
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007, 2010
    Posts
    25,770

    Re: hit error when use getobject()

    Just guessing (I've never automated PPT) that PresentationFileName should just be "xxx.ppt" (no path).
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    11-12-2009
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: error when use getobject()

    thanks.. i made a mistake.

    should be as following

    Set PPApp = GetObject(, "Powerpoint.Application")
    no need to fill up anything.

+ 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.2.0