PDA

View Full Version : use excel to import another excel file



crush
08-22-2007, 12:33 PM
I want to import data from a closed workbook into a currently open workbook.

The problem I have is that the closed workbook, when it opens, it runs macros in the Workbook_Open routine. Is there a way I can bypass the workbook open routines when I call it using VBA from my currently open workbook?

When the closed workbook is opened from excel or from double clicking the file in windows explorer, I want the Workbook_Open routines to run. But when I open the closed workbook, using VBA, from my currently open workbook, I don?t want the Workbook_Open routines to run.

I tried to set a ?public flag? in my currently open workbook, but when the closed workbook opens the public flag is ?empty?.

Basically I am trying to build an ?import? feature where by user data saved in the ?closed workbook? can be imported into a new version of the workbook.

Any help or suggestions would be welcomed

Kindest regards
CRush

paulked
08-22-2007, 12:42 PM
Would this help you out?

http://www.vbaexpress.com/kb/getarticle.php?kb_id=454

crush
08-22-2007, 12:53 PM
this may be exactly what i'm looking for... I?ll try it later this evening and let you know if I?m successful.

thanks for your help,

this forum is the best!

kindest regards
chris

crush
08-28-2007, 06:36 PM
i tried the link you refered too and managed to get things working for individual cells, the problem i have is i have serveral worksheets that i need to get data from and there's lots of data to retrieve. what i've opted to do for simplicity, is provide an export / import feature in my spreadsheet. Thus when I export data I create a new workbook with only the exported data (no macros), when I later import the data, I eliminate the issues related to workbook open macros wanting to run...

i guess this issue should be marked as solved now right?