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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieve and post data to a spreadsheet

Status
Not open for further replies.

hsviljoen

Programmer
May 26, 2004
73
ZA
Hi there - i need urgnet help with this....

i have two spreadsheet - the first have a macro that brings up a browse dialog box where the user chooses a spreadsheet. Then the macro open the selected spreadsheet... My idea is to import data into a listbox , the user then clicks on a list item which then update the data from the first workbook into the selected workbook...

Im running into trouble just after i open the workbook from the Browse function - none of the code after the Set wb = Workbooks.Open(File) line runs... meaning I cant select a certains sheet and do any of the other functions..

I hope this makes sense.

Any help will be much appreciated
 
Hi ...

I'm not sure but just after you open any Workbook, write this :

Set Your_new_Workbook = ActiveWorkbook

Rodie
 
I cant run any code after the Set wb = Workbooks.Open(File) statement
 
For each Workbook you open, do exactly that :
Code:
  Workbooks.Open ("name_1")  
  Set MyBook_1 = ActiveWorkbook
    ...
  Workbooks.Open ("name_2")  
  Set MyBook_2 = ActiveWorkbook
If it does not work after that, I really can't help you.
Above all, only 1 "set" per Workbook.

By hoping it will work.
Rodie

 
Sometimes, commenting out error trapping may help to understand what happens.
Anyway, feel free to post your code if you're still stuck with it.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top