Results 1 to 35 of 35

Compile Error: Can't find project or library (1 computer has the error, another does not?)

Threaded View

  1. #1
    Forum Contributor jonvanwyk's Avatar
    Join Date
    06-28-2010
    Location
    Iowa, USA
    MS-Off Ver
    Excel 2010
    Posts
    452

    Compile Error: Can't find project or library (1 computer has the error, another does not?)

    I have a request form that has been used by two departments for the past two years. After we went through an upgrade from Office 2007 to Office 2010, Department A is still able to use the form, while Department B receives the message "Compile Error: Can't find project or library". I have attached to this post a copy of the form, and a screenshot of the error being received by Department B. The form itself is much more complicated, but this is a simplified version that saves the PDF to your desktop so that it can be tested by anyone. If I can fix the error on this one, I should be able to incorporate the solution into the more complicated version.

    Thanks in advance for any help that comes my way!

    Screenshot of the Compile Error >>> Compile Error.jpg

    Sub sendpdf01()
    
        Dim FileName As String
        Dim UserDesktop As String
        Dim WshShell As Object
        
          Set WshShell = CreateObject("WScript.Shell")
          
          UserDesktop = WshShell.SpecialFolders(4) & "\"
          
            FileName = Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 5)
            ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:= _
               UserDesktop & Cells(2, 2).Value & " - " & Cells(6, 2).Value & ".pdf", _
                Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
                :=False, OpenAfterPublish:=False
            Range("A1:D28").Select
            
            MsgBox "This request has been saved to your desktop."
        
    End Sub
    Last edited by jonvanwyk; 06-28-2012 at 01:02 PM.

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