Selecting WorkSheets

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have code where i open up a worksheet and then i transfer imformation from
another sheet into it. This requireds a lot of going back betweet worksheets.
Workbooks.Open Filename:="K:\Purchasing
Documents\Railcar\ApprovedSupplier.xls"
'some more code
Workbooks.Open Filename:="K:\Purchasing Documents\Railcar\DrawingACK.xls"
'some more code
Workbooks("ApprovedSupplier").Activate

most of the time that works just fine, but every once in awhile if i am
using the program on another computer it will give me an error as if it
doesn't recognize that the file is already open.

Any thoughts on why that might happen?

Thanks,
Jordan
 
Try including the file extension, too:

Workbooks("ApprovedSupplier").Activate
becomes
Workbooks("ApprovedSupplier.xls").Activate

There's a windows setting that allows users to hide extensions of known file
types. And with that enabled, I bet your existing code works ok.

But including the .xls removes all worry.
 

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

Back
Top