Run-time error

G

Guest

I get the following error when I try to use the Sheets
(4).Select command line in one of my macros.

Run-time error '1004'
Select method of Worksheet class failed.

The error appears in the file I am trying to open ONLY
when another particular xl file is opened before it.
Otherwise the macro works fine.

All the files were created in the same XL version.

Can anyone pls help?
Thx
G
 
N

Nick Hodge

G

Excel could get confused with all the other workbooks opening. Have you
tried fully qualifying the sheet with the workbook it's in? as in

Workbooks("Book1").Sheets(3).select

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
[email protected]
 
G

Guest

Hi Nick,
Thx a ton for the earlier msg. Saw it only today.
I did try the suggestion you had and I am still getting
the same error.
Any help is greatly appreciated.
Thx
G
 
Top