开发者

How to Solve DLL error in access

开发者 https://www.devze.com 2023-01-02 10:55 出处:网络
I am developing an Excel project in Access using VBA. My project is working in Access 2007, 开发者_如何学Cbut it does not work in Access 2003. If I try to run the file, it shows the DLL error. Anyone

I am developing an Excel project in Access using VBA. My project is working in Access 2007, 开发者_如何学Cbut it does not work in Access 2003. If I try to run the file, it shows the DLL error. Anyone know how to debug this error?


It's pretty difficult to know what's causing your problem without knowing what error message you are getting and where it's occurring.

My best guess says that you are have a problem with a reference. Usually the best way to fix this is to change your code to use late binding if the version of Excel will not always be the same on every machine.

Consider the following 3 examples:

'This is early binding.
Dim oXLS As Excel.Application 
Set oXLS = New Excel.Application

'Create a new instance of an Excel Object using late binding
Dim oXLS As Object 
Set oXLS = CreateObject("Excel.Application")

'Set your object to an instance of Excel that is already open using late binding
Dim oXLS As Object 
Set oXLS = GetObject(, "Excel.Application")

It's easier to program using early binding because you can use intellisense. However, if your target machines might have differing versions of Excel you should consider using late binding in your production/deployment version for better compatibility.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号