Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm running Windows 2000 and Excel 2003.
When I run the code below, I get a "Run-time eorr '1004': Method 'Open' of object 'Workbooks' failed" error. Can someone tell me why? TIA Sub Macro() Workbooks.Open Filename:= _ "C:\downloads\GPF_PY.xls" End Sub -- Ken Hudson |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'd guess that the file didn't exist.
Typing error in the folder/filename???? Ken Hudson wrote: I'm running Windows 2000 and Excel 2003. When I run the code below, I get a "Run-time eorr '1004': Method 'Open' of object 'Workbooks' failed" error. Can someone tell me why? TIA Sub Macro() Workbooks.Open Filename:= _ "C:\downloads\GPF_PY.xls" End Sub -- Ken Hudson -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the reply. This was really puzzling to me.
The initial file was saved as a CSV file and then opened in Excel and saved as an Excel file. It did exist as an Excel file. The problem was that, when it was saved as a CSV file, its worksheet brought the default name ".csv)GENSOFMO(2)" with it. I saved the file in Excel with that worksheet name. I can open the workbook "manually", but got the error when trying to use VB. I renamed the worksheet and life is good again. -- Ken Hudson "Dave Peterson" wrote: I'd guess that the file didn't exist. Typing error in the folder/filename???? Ken Hudson wrote: I'm running Windows 2000 and Excel 2003. When I run the code below, I get a "Run-time eorr '1004': Method 'Open' of object 'Workbooks' failed" error. Can someone tell me why? TIA Sub Macro() Workbooks.Open Filename:= _ "C:\downloads\GPF_PY.xls" End Sub -- Ken Hudson -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Ken
This script will allow you to select the file you wish to open, if the format you want ins't csv then change it to desired format Application.DisplayAlerts = False Application.ScreenUpdating = False fileToOpen = Application _ .GetOpenFilename("Comma Delimited (*.csv), *.csv") If fileToOpen < False Then TextBox2.Value = "Opening " & fileToOpen Else Exit Sub End If Workbooks.OpenText Filename:="" & fileToOpen DoEvents -- Message posted via http://www.officekb.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run time error 1004, General ODBC error | New Users to Excel | |||
run-time error '1004': Application-defined or object-deifined error | Excel Programming | |||
Run time error '1004': Generaol ODBC error | Excel Programming | |||
Run time error 1004 General ODCB Error | Excel Programming | |||
Application Run Time Error 1004 and Stack Error | Excel Programming |