![]() |
|
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Posts: 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 ] |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Apr 2002
Location: Surrey, United Kingdom
Posts: 75
|
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 |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Posts: 81
|
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 |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Apr 2002
Location: Surrey, United Kingdom
Posts: 75
|
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.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|