ich habe ein Userform, in das ich ein Modul zum Drucken des Forms eingebunden habe, was auch unter Excel 2010 32 bit problemlos läuft. Jetzt hat es jemand unter Excel 2010 64 bit genutzt und erhält die Fehlermeldung:
Compile Error
The code in this project must be updatedfpor use on 64-bit system. Please review and update Declare statements and then mark them with the PTRSafe attribute.
Ausgelöst wird der Fehler wohl von diesen Zeilen:
Option Explicit
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Declare Function MapVirtualKey Lib "user32" Alias "MapVirtualKeyA" (ByVal wCode As Long, ByVal wMapType As Long) As Long
Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (LpVersionInformation As OSVERSIONINFO) As Long
Private Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type
Private Enum Constants
KEYEVENTF_KEYUP = &H2
VK_MENU = &H12
sngMargin = 1.5 'Breit der Seitenränder in cm
End Enum
Frage 1: Wie kann ich den Fehler eliminieren?
Frage 2: Wie kann ich sicherstellen, dass der Coder sowohl unter 32 als auch unter 64 bit funktionsfähig bleibt?
Danke im Voraus,
PQuest:-)