Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi! I have troubles with the Workbooks.Open method.
I want to open a file (power_budget.xls) from a main workbook with a userform menu (main.xls). I used Workbook.Open("power_budget.xls") method to open it and it works well, but now the problem arises. power_budget.xls should ask the user for the path of an excel file containing data to be imported. I stored the sub to show the form that asks for the path in ThisWorkbook with an event sub like this one: Private Sub Workbook_Open() userform.show End sub When the CommandButton I put in the userform is clicked, another event Sub should open the data file with a call like this: Set source = Workbook.Open("datafile.xls") then read the data and import them in power_budget.xls, but that doens't happen! When I ran the debugger I noticed that the source doesn't contain "datafile.xls" but "power_budget.xls" again, and I can't understand why this happens and how to fix it. I know the code stored in power_budget.xls is correct, because when I open it directly (without using main.xls), everything works in the right way. Can anyone help with this problem? 10x everybody Amarth |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
When I open Excel, workbooks open automatically. How can I stop t | Excel Discussion (Misc queries) | |||
Excel 2003 Workbooks.Open with CorruptLoad=xlRepairFile fails on Excel 5.0/95 file due to Chart, with Error 1004 Method 'Open' of object 'Workbooks' failed | Excel Programming | |||
Open method of workbooks fails when Excel is hosted in IE | Excel Programming | |||
EXCEL.exe stays open after Quit method in an HTA | Excel Programming | |||
Open Method of workbooks class failed | Excel Programming |