Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening an excel file with VB within Excel 2000 with or without the .xls suffix
I wrote a series of VB macros in May this year where I
would open an excel file sometimes with a ".xls" extension and sometimes without. Code variations looked like this: Workbooks.Open Filename:=("C:\test.xls") Workbooks.Open Filename:=("C:\test") Both versions of code worked fine for 6 months. Then in October any that did not have a ".xls" could not be found, even though the code was not changed in any way nor was the software version. eg. Workbooks.Open Filename:= ("C:\test") So I changed all of the macros to include a ".xls" Now in December, one of my macros cannot find a file unless the ".xls" extension is removed, and I check the file and made sure it was a standard excel 2000 workbook. Does anyone know why this is happening as it defies logic? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening an excel file with VB within Excel 2000 with or without the.xls suffix
First, it's better to include the .xls all the time.
But I bet something happened to your version of windows. Did you (or something) change the option to "hide file extensions for known file types" to hide them? In win98, I set this by: Open windows explorer View|Folder options View Tab toggle a setting. == As an aside, it's a good thing to see the file extensions all the time. If you get an attachment that says: myfile.txt, you'll think that it's a plain text file. But if you see that it's really myfile.txt.exe, you'll know not to open it. Malcolm Hinchliffe wrote: I wrote a series of VB macros in May this year where I would open an excel file sometimes with a ".xls" extension and sometimes without. Code variations looked like this: Workbooks.Open Filename:=("C:\test.xls") Workbooks.Open Filename:=("C:\test") Both versions of code worked fine for 6 months. Then in October any that did not have a ".xls" could not be found, even though the code was not changed in any way nor was the software version. eg. Workbooks.Open Filename:= ("C:\test") So I changed all of the macros to include a ".xls" Now in December, one of my macros cannot find a file unless the ".xls" extension is removed, and I check the file and made sure it was a standard excel 2000 workbook. Does anyone know why this is happening as it defies logic? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2000 file in use when opening xls file | Excel Discussion (Misc queries) | |||
Excel 2000 - Trouble Opening File | Excel Discussion (Misc queries) | |||
Probelm opening an excel 2000 file in excel 2003 | Excel Discussion (Misc queries) | |||
Excel 2000 shuts down after opening file | Setting up and Configuration of Excel | |||
Problem opening .htm file from Excel 2000 | Excel Programming |