Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to open another excel file from vba 1

Status
Not open for further replies.

Sarmx

Programmer
Jun 16, 2004
12
NL
Dear Friends,

I need to access the information on another excel
file (from a current excel file) i need some help

is it possible to just read the information and not
opening the other excel file???

please send me some codes thad does this, i am an experienced programmer but very new to Excel vba...

thank you much,

ps. i use excel 2002
 
You can use ADO (see ConnectionStrings.com for appropriate constring) through VBA, but then you have to treat the Excel sheet like a database.

It would be much easier to do something like this:

Code:
Dim Act as string
Dim NewWB as string

Act=Activeworkbook.Name

NewWB=WorkbookToOpen

Workbooks.Open(NewWB)

ActiveWindow.Visible = False'If you want to hide from other users

Sheets(Act).Activate

'...Use code to access ranges for data.

I hope this helps.



Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top