Results 1 to 21 of 21

Open file in folder on Desktop

Threaded View

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,064

    Open file in folder on Desktop

    I'm trying to open a file in a folder on every user's desktop. The file exists in a folder called "Resources". I tried to use the code from this posting; http://www.excelforum.com/excel-prog...op-folder.html
    but it's not working. My code exists in the "Workbook/Open" module. I'm getting a Run-Time error of 1004, saying it can't find the file. I'd appreciate any help you can provide in trouble-shooting my code.

    Thanks,
    John
    Option Explicit
    Public Function GetDesktop() As String
        GetDesktop = CreateObject("WScript.Shell").SpecialFolders("Desktop") & _
            Application.PathSeparator
    End Function
    Private Sub Workbook_Open()
    With Application
            .ScreenUpdating = False
            .EnableEvents = False
    Dim Path      As String
    Dim FileName1  As String
    
    
    Path = GetDesktop & "Resources\"
    Path = Path & Application.PathSeparator
    FileName1 = Dir(Path & "PAID_FTES_BR2010.xls", vbNormal)
     
    Workbooks.Open FileName1, ReadOnly:=True
    Last edited by jomili; 09-17-2010 at 10:35 AM.

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