Apr 11 2007, 09:37 PM
Can automation work with these two.
I have a db that works fine except when I installed it on a PC that has office 2003 and excel 2002.
Apr 11 2007, 10:26 PM
what type of automation are you using? Are you using early binding which relies on a reference?
BTW...why would there be a separate Excel version? Excel is part of the Office suite (even the most basic) so either they have Office 2002 and 2003 or just one of the two.
Apr 12 2007, 12:32 AM
In the db I created it references Excel 11.0
When installed on the new user's system it had a missing link error. The references had a missing link to Excel 11.0
When unchecked the missing link reference there was no more error but the Excel conversion/save as did not work.
So I had the user check the versions of Excel and it had 2002. But the office was 2003. Not sure what to make of that. the reference for Excel available was 10.0. So I need to get the user to see if 10.0 would work.
Basically what the automation is doing is ...
Get a file that can be opened with Excel (but not an Excel File) and save it as XLS then import it into a table.
Apr 12 2007, 12:47 AM
I run into the mixed environment when someone installs a Access 2003 runtime app on a machine that has Office 2002 standard (no Access) already installed. I have a client who has Office 2002 standard then purchased Access 2003 separately. Unfortunately a mixed environment of Office products does happen. I see it the most with non-profits, schools, and government agencies which all have very limited budget and/or depend on handed-down/traded or donated software. I have learned to use, as you suggested, late binding, which works most of the time.
Apr 12 2007, 07:26 AM
Yes that is understandable with MS Access...but Excel? Excel is part of any Office suite
Apr 12 2007, 07:27 AM
try to convert your code to late binding so it isn't reference dependent. Than it doesn't matter what version the user's computer supports.
Apr 12 2007, 09:52 AM
This is what I'm using...
Dim xlApp As Object
Dim xlSheet As Object
Set xlApp = CreateObject("Excel.Application")
Set xlSheet = xlApp.workbooks.Open(Strpath & strfile).Sheets(1)
What would be the late binding method?
Apr 12 2007, 09:55 AM
Mhhh...that already looks like late binding. Do you have the Excel Object library set on top of this? You won't need it anymore with that.
Apr 12 2007, 10:31 AM
Yes when I removed the reference on my system it did the I got an
error 1004 SaveAs method of workbook calss failed error.
This is the code highlighted:
.ActiveWorkbook.SaveAs Filename:= _
"C:\Folder\NCheck\" & Left(strfile, 8) & ".xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
Edited by: GRO on Thu Apr 12 11:33:42 EDT 2007.
Apr 12 2007, 03:22 PM
does the file already exist with the same name in the same directory?
Apr 12 2007, 05:37 PM
I noticed that after the first attempt to open the db and since the reference to XL 11.0 was missing the code got interrupted. so the excel.application opened but never closed.
So I had the user reference it to 10.0 and reboot the system and it works fine now.
Thanks Oli an Boyd for all your help.
Apr 12 2007, 06:34 PM
Glad you got it sorted out.
Good luck on future projects!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here