motabrasil
Member
Hi everyone
It's very nice to be back to this forum. Need your priceless support one more time.
Here is my history:
I got a situation after update my Office pack from 2010 to 2016. Several of my macros stopped working and was necessary make them work with 32 and 64 bits. But now, I got one issue that I'm not able to fix. Few macros have a password mask inputbox in order to identify the user. However, every time the code cross the line "hHook = SetWindowsHookEx(WH_CBT, AddressOf NewProc, lngModHwnd, lngThreadID)" the Excel crashed. See the code:
This macro still working fine when use 2013 or older excel version
Any help will be very appreciated.
Thanks
It's very nice to be back to this forum. Need your priceless support one more time.
Here is my history:
I got a situation after update my Office pack from 2010 to 2016. Several of my macros stopped working and was necessary make them work with 32 and 64 bits. But now, I got one issue that I'm not able to fix. Few macros have a password mask inputbox in order to identify the user. However, every time the code cross the line "hHook = SetWindowsHookEx(WH_CBT, AddressOf NewProc, lngModHwnd, lngThreadID)" the Excel crashed. See the code:
Code:
Function InputBoxDK(Prompt, Title) As String
#If VBA7 Then
Dim lngModHwnd As LongPtr
#Else
Dim lngModHwnd As Long
#End If
Dim lngThreadID As Long
lngThreadID = GetCurrentThreadId
lngModHwnd = GetModuleHandle(vbNullString)
hHook = SetWindowsHookEx(WH_CBT, AddressOf NewProc, lngModHwnd, lngThreadID)
InputBoxDK = InputBox(Prompt, Title)
UnhookWindowsHookEx hHook
End Function
This macro still working fine when use 2013 or older excel version
Any help will be very appreciated.
Thanks