Hi , I have an Excel workbook with extensive VBA code using Access 2003 and 32 bit Windows XP. I have recently installed 64 bit Windows 7 with Access 2010 and when I try to run the workbook, I get the following error message:
Code must be updated for 64 bit systems. POlease review and update Declare statements and then mark them with the PtrSafe attribute.
The code below uses a function that I often use.
Can anyone please advise how I should proceed with the Declare statement update? I have never heard of PtrSafe.
I would welcome all comments and suggetions
Code must be updated for 64 bit systems. POlease review and update Declare statements and then mark them with the PtrSafe attribute.
The code below uses a function that I often use.
Can anyone please advise how I should proceed with the Declare statement update? I have never heard of PtrSafe.
I would welcome all comments and suggetions
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
(ByVal hWnd1 As Long, ByVal hWnd2 As Long, _
ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Any) As Long
'------------------------------------------------------
' widen the Excel Names drop down menu
Sub WidenNameBoxDrop2()
Dim Res As Long
Const CB_SETDROPPEDWIDTH = &H160
Const cWidth = 400 '<<<<<<<<<<<<<<<<<<<<<<
Res = SendMessage( _
FindWindowEx( _
FindWindowEx( _
FindWindow("XLMAIN", Application.Caption) _
, 0, "EXCEL;", vbNullString) _
, 0, "combobox", vbNullString), _
CB_SETDROPPEDWIDTH, cWidth, 0)
End Sub