당신은 대부분의 인코딩 형식
예를 들어
를 표시해야하는 대신 윈도우 API 메시지 상자를 사용할 수 있습니다,이 내가 나와 함께 64 비트 머신이없는
MODULE
Option Explicit
#If Win64 Then
Private Declare PtrSafe Function User32MsgBox Lib "user32" Alias "MessageBoxW" _
(Optional ByVal hWnd As Long, Optional ByVal Prompt As Long, _
Optional ByVal Title As Long, Optional ByVal Buttons As Long) As Long
#Else
Private Declare Function User32MsgBox Lib "user32" Alias "MessageBoxW" _
(Optional ByVal hWnd As Long, Optional ByVal Prompt As Long, _
Optional ByVal Title As Long, Optional ByVal Buttons As Long) As Long
#End If
Public Function MessageBoxW(cPrompt As String, _
Optional cButtons As VbMsgBoxStyle = vbOKOnly, _
Optional cTitle As String) As Long
MessageBoxW = User32MsgBox(0, StrPtr(cPrompt), StrPtr(cTitle), cButtons)
'*****Probably need to convert StrPtr to 32bit long on 64bit - see next line
'MessageBoxW = User32MsgBox(0, cLng(StrPtr(cPrompt)), CLng(StrPtr(cTitle)), cButtons)
End Function
Sub MyMacro()
Dim txt As String
txt = Sheets("Sheet1").Cells(1, 1).Value
MessageBoxW (txt)
End Sub
로 전환 순간적으로 64 비트 컴퓨터에서 StrPtr을 32 비트 Long으로 변환해야 할 수도 있습니다.
64 비트 시스템에서 VBA의 API 호출 수정에 대한 정보는 http://msdn.microsoft.com/ko-kr/library/에 있습니다. office/ee691831.aspx # odc_office2010_Compatibility32bit64bit_ApplicationProgrammingInterfaceC 겸용성 – barrowc