Opening workbook in existing excel application

Stocky262
04-18-2008, 01:23 AM
I am trying to write some code which will open a workbook into an already opened instance of an excel application. The only code i could find on the internet would create a new excel application for each workbook you would like to open.

I would like to then automatically run code which is within the excel workbook i want to open (the code will use workbooks already opened which is why i need everything open in the one excel application)

It may involve a system call to return an object of the current opened excel application or perhaps it is simplier than this... Can anyone help?:)

MPi
04-18-2008, 04:14 AM
To open a workbook, just use Workbooks.Open("Path and Name of the file")

To run a macro from this newly opened workbook, I think that the RUN command of the Application object should do it. But I think that the macro will have to be in a Module and declared as Public, and you will have to specify the name of the workbook when calling that macro.

Give it a try and look in your Excel help file.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum