re-opening a new workbook

Jackeb

Board Regular
Joined
Mar 20, 2002
Messages
81
Hi,

I have used these lines:

Set eap = CreateObject("Excel.Application")
eap.Visible = True
Set ewb = eap.Workbooks.Open("Eudims07PMPackagePMProgramS.xls")
ewb.activate

to open a workbook from another one. This works fine the first time. However once the workbook has been opened and closed (the workbook, not the excel program) This line won't re-open the workbook.

Does anyone know how to deal with this?

Cheers

Ed
This message was edited by Jackeb on 2002-04-29 02:03
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Hi,

Not sure why that is happening, though hopeully this may be of some use to you. I always open workbooks through VBA with the following code:

Sub open_workbook()
Workbooks.Open ("C:WINNTDesktopBook1.xls")
End Sub

I have never had a problem with reopening workbooks using this method.

Nibbs
 
Upvote 0
cheers...

it has got me too.... rather i guess it is catching the file somewhere and the code thinks that it is already open?

Ed
 
Upvote 0
That sounds likely. If you do use the code I suggested it will just reopen the file each time - if you have made changes and not saved, it will warn you that they will be discarded and give you an option to cancel.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,755
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top