2016-06-21 3 views
0

을 엑셀 2010 32 비트에서 64 비트로 업그레이드 한 후 excel-VBA 개체를 인식 할 수 없습니다. 새 버전에서 만드는 모든 개체는 다른 컴퓨터에서 인식 할 수 없으므로 2010 년 32 비트를 Excel에서 삽입하려고했습니다. 이 :업그레이드 후 Excel 버전

If VBA7 = True Then 
' 32 Bit API 
Private Declare PtrSafe Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As LongPtr 
Private Declare PtrSafe Function GetExitCodeProcess Lib "kernel32" (ByVal hProcess As LongPtr, lpExitCode As Long) As Long 
Else ' 64 bit API 
    Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long 
    Private Declare Function GetExitCodeProcess Lib "kernel32" (ByVal hProcess As Long, lpExitCode As Long) As Long 
End If 

그리고 작동하지 않습니다.

PLZ 도움말 :

+0

어떤 종류의 도움이 필요합니까? –

+0

32bit 및 64bit 파일을 사용할 수있게하고 싶습니다 – Tzahi

답변

1

조건부 컴파일을 수정 아니에요. 다음과 같이 표시되어야합니다.

#If VBA7 Then 
    ' 64 Bit API 
    Private Declare PtrSafe Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As LongPtr 
    Private Declare PtrSafe Function GetExitCodeProcess Lib "kernel32" (ByVal hProcess As LongPtr, lpExitCode As Long) As Long 
#Else ' 32 bit API 
    Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long 
    Private Declare Function GetExitCodeProcess Lib "kernel32" (ByVal hProcess As Long, lpExitCode As Long) As Long 
#End If 
+0

시도해 보았습니다 ... maby 나는 그것을 올바르게 사용하지 않았습니까? 나는 이것을 과거에해야 할까? – Tzahi

+0

"작동하지 않는다"는 것은 무엇을 의미합니까? 무슨 일이야? – Rory

+0

나는 버튼을 클릭하여 아무 일도 일어나지 않는다. 만약 디자인 모드로 들어가서 버튼에 duble를 클릭하면 새 메서드 creted가 새 이름이되었다. – Tzahi

관련 문제