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
(e-mail address removed)
 
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
 

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