macro doesnt run

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.
 
D

Dave Peterson

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???
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top