macro doesnt run

  • Thread starter Thread starter Illuminati
  • Start date Start date
I

Illuminati

I wrote macro that opens file with the name from the cell B8. The file
is placed in the same folder as the file with macro. The macro worked
few days ago, but now does not work at all.
Whats wrong with it ?

Here is the code:

Sheets("Instruction").Select
Workbooks.Open Filename:= _
".\" & Range("B8").Value & ".xls"

The error 1004 occurs when I try to run it (cannot find the file), but
file is placed for sure. Actually it works when I put the full name
and path where the file is placed, but it doesnt satisfy me.
 
Depending on where the code is, maybe the code isn't picking up the correct B8
cell.

Sheets("Instruction").Select
Workbooks.Open Filename:=".\" & sheets("instruction").Range("B8").Value & ".xls"

Or it may be a problem with what's in B8--is it a number/time/date???
 
Back
Top