S
shikha77
I am getting this error -2147467259 Unexpected Error from externa
database driver when running a vba macro code at this line-.Provider
"Microsoft.ACE.OLEDB.12.0"
in below code-
Code
-------------------
MyConn = _
"Data Source=" & ThisWorkbook.FullName & ";" & _
"Extended Properties=Excel 12.0;"
Set Cn = New ADODB.Connection
With Cn
.Provider = "Microsoft.ACE.OLEDB.12.0"
.Open MyConn
End With
-------------------
This is a simple vba macro (not using .net,sql server or ms access)
Only excel is used. This works fine in following combinations- Exce
2007 & Windows Xp, Excel 2007 & Windows 7. But in Windows 7 and Exce
2010 it gives this error if the user is not admin. Interestingly, i
Windows 7 and Excel 2010, if i login through admin user OR RUn
excel.exe by clicking "Run as administrator" option (start-typo
excel-shift +right click-run as administrator)and then opening my exce
file it does not give this error and more interestingly if afte
logging once through admin user and opening this excel file and closin
it, I then log off and log in as normal user and open my excel file
still do not get this error.So the thing is that ONE TIME login as admi
and opening this excel file temporariily fixes the issue.BUT the proble
is that i need to distribute this application to various users and the
will be logging it as normal users and i can not ask them to first logi
as admin user. Why this issue is ioccuring and what is the resolutio
for this? thanks
database driver when running a vba macro code at this line-.Provider
"Microsoft.ACE.OLEDB.12.0"
in below code-
Code
-------------------
MyConn = _
"Data Source=" & ThisWorkbook.FullName & ";" & _
"Extended Properties=Excel 12.0;"
Set Cn = New ADODB.Connection
With Cn
.Provider = "Microsoft.ACE.OLEDB.12.0"
.Open MyConn
End With
-------------------
This is a simple vba macro (not using .net,sql server or ms access)
Only excel is used. This works fine in following combinations- Exce
2007 & Windows Xp, Excel 2007 & Windows 7. But in Windows 7 and Exce
2010 it gives this error if the user is not admin. Interestingly, i
Windows 7 and Excel 2010, if i login through admin user OR RUn
excel.exe by clicking "Run as administrator" option (start-typo
excel-shift +right click-run as administrator)and then opening my exce
file it does not give this error and more interestingly if afte
logging once through admin user and opening this excel file and closin
it, I then log off and log in as normal user and open my excel file
still do not get this error.So the thing is that ONE TIME login as admi
and opening this excel file temporariily fixes the issue.BUT the proble
is that i need to distribute this application to various users and the
will be logging it as normal users and i can not ask them to first logi
as admin user. Why this issue is ioccuring and what is the resolutio
for this? thanks