Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default macro doesnt run


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.









  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default macro doesnt run

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



Illuminati wrote:

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.


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why doesnt it change sheet in the macro [email protected] Excel Worksheet Functions 1 April 24th 07 06:06 PM
My first macro, uses Vlookup but doesnt update unless hit enter James Cornthwaite Excel Worksheet Functions 1 May 24th 06 10:01 PM
some functions doesnt work in macro? ExcelPower[_2_] Excel Programming 3 February 20th 06 07:36 AM
Please help : Macro doesnt work on other PCs Jason Excel Programming 2 December 26th 05 09:49 AM
running a macro ina workbook that doesnt have that macro Paul Excel Programming 2 February 18th 04 01:47 AM


All times are GMT +1. The time now is 05:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"