how to open a workbook when application excel is running ?

M

Michel Angelosanto

hello,

I have an application wich runs Internet explorer and open a distant
workbook but the workbook do not open because excel macro is running.

Has a command in vba to let excel allow openning the workbook and continue
execution of the macro?

I want to open the workbook, read the data in it and close it, then open
other workbook read data and close it etc ...
I have tried DoEvents without success.

Thanks
 
J

Joel

you probably ned to open a new excel application and launch the web workbooks
with the new application

Set obj = createobject("Excel.application")
 
M

Michel Angelosanto

No it's not thus,
i open a main workbook witch is going to read several workbooks opened
succesfully with internet, and closed after reading.

I proceed thus:
in excel i open the main workbook
i open internet explorer and proceed the login manually or with a macro.
Now i am ready to start the robot
i run a macro on main workbook to send to IE the adress web
the same macro send with sendkeys the commands to open the workbook into
excel, imediately in excel i open a userform with a button, shell a script
vbs and close the macro
When the macro is closed the workbook can open into excel
the script vbs looks for the workbook is open and when the workbook is open
send a enter command to excel wich is equal to click on the button of the
userform wich start again the same macro to continue with the folowing file
to read and so on ...
This works fine!
 
J

Joel

The workbook is probably opened it is just not visible. Open the Task
manager before you run your code and see if another instance of excel is
created from your macro. You can get all the open instances of excel usingt
this code

for each exc in workbooks

next exc
 

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

Top