Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Program not working after upgrade
The following line of code worked before I was upgraded to
Windows XP and Excel 2002. Workbooks.Open Filename:="C:\Inetpub\wwwroot\BCC\documents\2004_E _M_Calend ar_" & reportDate & ".xls" The program stops at the above line with the message: Run-time error '1004': Method 'Open' of object 'Workbooks' failed The rest of the program works if I manually open the workbook and continue with the rest of the code. Any suggestion is appreciated. Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Program not working after upgrade
have you checked that reportDate contains the string that you expect it to
contain, in the same format as your old operating system used? Or have you checked the path is still the same, since you've upgraded? hth "Patrick I" wrote in message ... The following line of code worked before I was upgraded to Windows XP and Excel 2002. Workbooks.Open Filename:="C:\Inetpub\wwwroot\BCC\documents\2004_E _M_Calend ar_" & reportDate & ".xls" The program stops at the above line with the message: Run-time error '1004': Method 'Open' of object 'Workbooks' failed The rest of the program works if I manually open the workbook and continue with the rest of the code. Any suggestion is appreciated. Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Program not working after upgrade
I just tested this
Workbooks.Open Filename:="C:\myfolder\myfile.xls" It could be as simple as Open _ with the space & dash missing or spelling "Patrick I" wrote in message ... The following line of code worked before I was upgraded to Windows XP and Excel 2002. Workbooks.Open Filename:="C:\Inetpub\wwwroot\BCC\documents\2004_E _M_Calend ar_" & reportDate & ".xls" The program stops at the above line with the message: Run-time error '1004': Method 'Open' of object 'Workbooks' failed The rest of the program works if I manually open the workbook and continue with the rest of the code. Any suggestion is appreciated. Thanks. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Program not working after upgrade
Yep. I checked that the reportDate is still good and I've
double checked my path to be exactly the same. Thanks. -----Original Message----- have you checked that reportDate contains the string that you expect it to contain, in the same format as your old operating system used? Or have you checked the path is still the same, since you've upgraded? hth "Patrick I" wrote in message ... The following line of code worked before I was upgraded to Windows XP and Excel 2002. Workbooks.Open Filename:="C:\Inetpub\wwwroot\BCC\documents\2004_E _M_Calend ar_" & reportDate & ".xls" The program stops at the above line with the message: Run-time error '1004': Method 'Open' of object 'Workbooks' failed The rest of the program works if I manually open the workbook and continue with the rest of the code. Any suggestion is appreciated. Thanks. . |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Program not working after upgrade
Okay. I created the path and file name noted below and it
DOES open in my program. Hmmm... I know everything is correct as far as the path and file name with my original, however, when I attempt to open the file with Windows Explorer I get a "Renamed invalid sheet name" error message. -----Original Message----- I just tested this Workbooks.Open Filename:="C:\myfolder\myfile.xls" It could be as simple as Open _ with the space & dash missing or spelling "Patrick I" wrote in message ... The following line of code worked before I was upgraded to Windows XP and Excel 2002. Workbooks.Open Filename:="C:\Inetpub\wwwroot\BCC\documents\2004_E _M_Calend ar_" & reportDate & ".xls" The program stops at the above line with the message: Run-time error '1004': Method 'Open' of object 'Workbooks' failed The rest of the program works if I manually open the workbook and continue with the rest of the code. Any suggestion is appreciated. Thanks. . |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Program not working after upgrade
Have you tried recording a macro whilst manually opening
your file, then compare new vs the old (including reportDate). To be sure code each into cells, and in another try =A1=A2 Regards, Sandy -----Original Message----- The following line of code worked before I was upgraded to Windows XP and Excel 2002. Workbooks.Open Filename:="C:\Inetpub\wwwroot\BCC\documents\2004_ E_M_Calen d ar_" & reportDate & ".xls" The program stops at the above line with the message: Run-time error '1004': Method 'Open' of object 'Workbooks' failed The rest of the program works if I manually open the workbook and continue with the rest of the code. Any suggestion is appreciated. Thanks. . |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Program not working after upgrade
Yes I did. Thanks for the suggestion. I believe the code
is correct. It's the error message that pops up when opening the book that is causing the problem. BEGIN ERROR MESSAGE Errors were detected in [filename] but Microsoft Excel was able to open the file by making the repairs listed below. Save the file to make these repairs permanent. Renamed invalid sheet name. END ERROR MESSAGE I'm now trying to find out how to prevent this message from popping up (there is nothing wrong with the "sheet name"). -----Original Message----- Have you tried recording a macro whilst manually opening your file, then compare new vs the old (including reportDate). To be sure code each into cells, and in another try =A1=A2 Regards, Sandy -----Original Message----- The following line of code worked before I was upgraded to Windows XP and Excel 2002. Workbooks.Open Filename:="C:\Inetpub\wwwroot\BCC\documents\2004 _E_M_Cale n d ar_" & reportDate & ".xls" The program stops at the above line with the message: Run-time error '1004': Method 'Open' of object 'Workbooks' failed The rest of the program works if I manually open the workbook and continue with the rest of the code. Any suggestion is appreciated. Thanks. . . |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Program not working after upgrade
Are there any apostrophe's or spaces, if so see
http://support.microsoft.com/?id=107468 Regards, Sandy -----Original Message----- Yes I did. Thanks for the suggestion. I believe the code is correct. It's the error message that pops up when opening the book that is causing the problem. BEGIN ERROR MESSAGE Errors were detected in [filename] but Microsoft Excel was able to open the file by making the repairs listed below. Save the file to make these repairs permanent. Renamed invalid sheet name. END ERROR MESSAGE I'm now trying to find out how to prevent this message from popping up (there is nothing wrong with the "sheet name"). -----Original Message----- Have you tried recording a macro whilst manually opening your file, then compare new vs the old (including reportDate). To be sure code each into cells, and in another try =A1=A2 Regards, Sandy -----Original Message----- The following line of code worked before I was upgraded to Windows XP and Excel 2002. Workbooks.Open Filename:="C:\Inetpub\wwwroot\BCC\documents\200 4_E_M_Cal e n d ar_" & reportDate & ".xls" The program stops at the above line with the message: Run-time error '1004': Method 'Open' of object 'Workbooks' failed The rest of the program works if I manually open the workbook and continue with the rest of the code. Any suggestion is appreciated. Thanks. . . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro stopped working after upgrade to 2007 | Excel Discussion (Misc queries) | |||
Excel is not working (may be a program file damaged) | Setting up and Configuration of Excel | |||
Is there a way to unload the loaded XLL file in Excel? Hi all, I amdebugging XLL link library using Visual C++. Everytime I rebuild the XLL, Ihave to close the whole Excel program and relaunch the Excel program again,and then load in the newly gene | Excel Discussion (Misc queries) | |||
=networkdays formula was working, but not in upgrade to 2003 | Excel Worksheet Functions | |||
working with excel and other program | Excel Discussion (Misc queries) |