+ Reply to Thread
Results 1 to 3 of 3

error when opening file

  1. #1
    Valued Forum Contributor
    Join Date
    11-16-2004
    Location
    Devon UK
    MS-Off Ver
    2010
    Posts
    357

    error when opening file

    using the code below I ge the error 'Specified file not found' and the final part of the last line from 'The Workbook.Open ' is highlighted in yellow. However if from this point I press F5 then the file is opened and the code continues to run. any idea's why it doesn't find the file first time around?

    PHP Code: 
    strpath ThisWorkbook.Path "\"
    If Dir(ThisWorkbook.Path & "
    \data file.xls") <> "" Then
           Application.ScreenUpdating = False

            If Not Evaluate("
    ISREF('[data file.xls]Sheet1'!A1)") Then Workbooks.Open (strpath & "data file.xls") 
    Last edited by tryer; 12-06-2011 at 02:15 PM.

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: error when opening file

    Please Login or Register  to view this content.



  3. #3
    Valued Forum Contributor
    Join Date
    11-16-2004
    Location
    Devon UK
    MS-Off Ver
    2010
    Posts
    357

    Re: error when opening file

    Thank you snb very helpful as always

+ 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