access sheets in another workbook

  • Thread starter Thread starter Stuby
  • Start date Start date
S

Stuby

Hi

How do I access a sheet in another workbook? Due to the data getting
very large I wish to separate all my code into one excel xls and the
data into another that way I can continue to develop the application
without the need to cut and past all the sheets into my new xls each
time I make a code change.


Regards

Stuby
 
Workbooks("otherbook.xls").Worksheets("Sheet1")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
That what I thought my code is as follows

Workbooks("h:\sdrdata.xls").Worksheets("SDRstats").Active

but I get a run-time error "9" subscript out of range

Any thoughts

Regards

Stuby
 
No, workbooks refers to the workbooks collection, that is the workbooks open
in that application., not a workbook on a drive.

Also it is Activate, not Active.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Found the problem I think, which has created a new one. If I remove
the h:\ it works which brings me to the next question, My file is
stored on a server get to it I need to a path such as
\\someserver\sharefolder\folder\ how do I get it to do this.


Regards

Stuby
 
open it.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Bob many thanks.

open it.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

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