xlapp.workbooks.open(filename)

Wait, your original line was...

Code:
.ConnectionString = "Data Source='" & filename & "'; " & "Extended Properties='Excel 8.0;HDR=Yes;IMEX=1'"
...which is way different than what you have now. Did you write this code?
 
HI Gina,

Original code was as you mentioned, yes the below, which still works fine for ms office 2007, and able to accept xlsm files.

Code:
.ConnectionString = "Data Source='" & filename & "'; " & "Extended Properties='Excel 8.0;HDR=Yes;IMEX=1'

The problem arose, when I started to work in another workstation, where the MS office was 2010, then as suggested I changed the connection string as follows, and I have not found the joy.

Code:
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\myFolder\myExcel2007file.xlsm;
Extended Properties="Excel 12.0 Macro;HDR=YES";

Thanks,

Antonio
 
Hmm, getting stumped... What happens if you change it to a regular .xlsx file with the updated line? Also, have you tried putting break points and then checking what the code sees as the file name?
 
Hi Gina,

Tried xlsx, and resulted the same 1004 error, the code breaks in the same place where I have mentioned in red font.

Thanks,

Antonio
 
What about Breakpoints? Did you see what it thinks the name of the file is?
 
Hi Gina,

I have resolved the issue, by doing nothing in the coding nor adding a library.

How I resolved is, by simply installing the service pack 2 for the MS Office suite 2010.

Gina - By the way, is there a way, I could mention or change status RESOLVED.

BY the way, I will open another thread on another issue, please do help me on that too.

Thanks,

Antonio
 
Well, I'll be... well at least it's resolved. I do not know how to make a thread resolved having never created one and I think only the creator can do so. If I find out how I will post back.

I'll look for your other thread and see how it's going...
 
The service pack must have helped, but the first thing I think about when someone tells me x64 fails, x32 succeeds, is that one of the external libraries needs something to be declared using the PtrSafe option on the object variables. In x32 libraries, addresses are 32 bits. In x64 libraries, some pointers for objects are 64 bits AND are not necessarily just sign-extensions of the 32-bit pointers (object variables).
 

Users who are viewing this thread

Back
Top Bottom