In order to get the file to work I have to File-open(file type is .xls),
Save-as type xls (Same type). After this operation of saving it in whta is
apparently the same format everything works fine.
I'm running SQL server 2000.
Any clues?
Steve S
I can't find in Microsoft's support records that anyone has ever reported
this exact error message/number in connection with an Excel file, but it
seems obvious that the file from your vendor is either damaged or flawed in
some way, or not the version he says it is. I suspect it would be difficult
to pinpoint the problem. Any chance it's just a .CSV file that the vendor
renamed .XLS? Does the file size change noticeably when you re-save it?
You could automate the open/re-save using Excel Automation (hear that,
Allan?) but would want to take care to specify all options to suppress
dialogs and "are you sure" messages if your DTS packages run unattended.
-Doug
This posting is provided "AS IS" with no warranties, and confers no rights.
Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.
Thanks
Steve S
""Douglas Laudenschlager [MS]"" <doug...@online.microsoft.com> wrote in
message news:uxRofaxQCHA.2372@cpmsftngxa06...
Error Message =Run-time error '1004':
"You cannot save this workbook with the same name as another open workbook
or add-in. Choose a different name, or close the other workbook or add-in
before saving.
Here is the piece of code I am using;
Dim xlApp As Object
Set xlApp = CreateObject("Excel.Application")
xlApp.workbooks.Open FileName:=m_sImpFile 'This is a global
variable with the filename
xlApp.Visible = False
xlApp.Save m_sImpFile
m_sActiveSheetName = xlApp.ActiveSheet.Name & "$" ' I need this
to pull the correct sheet as a database (the name changes)
xlApp.workbooks.Close
Also, I have determined it is an Excel 5.0/95 format
My connection string for ADO access is
strConnExc = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & m_sImpFile & ";" & _
"Extended Properties=""Excel 8.0;HDR=YES;"""
Any clues?
TIA
Steve
""Douglas Laudenschlager [MS]"" <doug...@online.microsoft.com> wrote in
message news:uxRofaxQCHA.2372@cpmsftngxa06...
>
There are lots of articles in MSDN for error 1204.
XL2002: Error Message Method SaveAs of Object _Worksheet Failed
They in the main relate to Excel 2000 and 2002 but they might be worth
a look. Douglas has a large list of Excel related issue he usually
hands out as well.
Allan
www.SQLDTS.com
Allan Mitchell
www.SQLDTS.com