问题:运行时错误429 - ActiveX组件无法创建对象 [英] Issue : Runtime Error 429 - ActiveX Component Can't Create Object
问题描述
我使用Excel工作VBA,Windows OS(32位)和Office 2007(办公室32位)工作正常当我开始使用Windows 8(64位)和Office 2010(64位)时,我无法运行应用程序,因为excel Office 2010附带了以下代码行,因为VBA7。
I working on VBA with Excel, Which working fine with windows OS (32 bit) and office 2007(office 32 bit) When i started work on Windows 8 (64 bit) and office 2010 (64 bit) i was unable to run the application so for below line of code i added because of excel office 2010 is comes with VBA7.
#If VBA7 Then
Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As LongPtr)
#Else
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
#End If
#If VBA7 Then
Declare PtrSafe Function CreateFile Lib "kernel32" Alias "CreateFileA" (ByVal lpFileName As String, ByVal dwDesiredAccess As LongPtr, ByVal dwShareMode As LongPtr, ByVal lpSecurityAttributes As Any, ByVal dwCreationDisposition As LongPtr, ByVal dwFlagsAndAttributes As LongPtr, ByVal hTemplateFile As LongPtr) As Long
Declare PtrSafe Function WriteFile Lib "kernel32.dll" (ByVal hFile As LongPtr, ByRef lpBuffer As Any, ByVal nNumberOfBytesToWrite As LongPtr, ByRef lpNumberOfBytesWritten As LongPtr, ByRef lpOverlapped As LongPtr) As Long
Declare PtrSafe Function ReadFile Lib "kernel32" (ByVal hFile As LongPtr, ByRef lpBuffer As Any, ByVal nNumberOfBytesToRead As LongPtr, ByRef lpNumberOfBytesRead As LongPtr, ByRef lpOverlapped As Any) As Long
Declare PtrSafe Function CloseHandle Lib "kernel32.dll" (ByVal hObject As LongPtr) As Long
#Else
Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" (ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, ByVal lpSecurityAttributes As Any, ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long) As Long
Declare Function WriteFile Lib "kernel32.dll" (ByVal hFile As Long, ByRef lpBuffer As Any, ByVal nNumberOfBytesToWrite As Long, ByRef lpNumberOfBytesWritten As Long, ByRef lpOverlapped As Long) As Long
Declare Function ReadFile Lib "kernel32" (ByVal hFile As Long, ByRef lpBuffer As Any, ByVal nNumberOfBytesToRead As Long, ByRef lpNumberOfBytesRead As Long, ByRef lpOverlapped As Any) As Long
Declare Function CloseHandle Lib "kernel32.dll" (ByVal hObject As Long) As Long
#End If
它工作正常,但当我尝试访问应用程序时,我收到错误运行时错误429 - ActiveX组件无法创建对象
我的问题:
1.在12月上旬做了任何错误lared Code?
2.可以强制在64位操作系统上运行32位COM对象和如何?
it worked fine But when i try to Access the Application i am getting Error "Runtime Error 429 - ActiveX Component Can''t Create Object "
My Problem :
1. did any mistake in above Declared Code ?
2. can force to run 32 bit COM object on 64 bit OS and How ?
推荐答案
我不是知道确切的答案,但我建议你去试试这些:
编译器常量 [ ^ ]
32之间的兼容性Office 2010的位和64位版本 [ ^ ]
64位Visual Basic for Applications概述 [ ^ ]
D. ebug您的代码并检查程序挂起的位置(显示错误)。
I don''t know the exact answer, but i would suggest you to tefer these:
Compiler Constants[^]
Compatibility Between the 32-bit and 64-bit Versions of Office 2010[^]
64-Bit Visual Basic for Applications Overview[^]
Debug your code and check where the program hangs-up (showing error).
这篇关于问题:运行时错误429 - ActiveX组件无法创建对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!