User-defined type not defined
Solved
Thierry
-
thierry -
thierry -
Hello everyone,
Is there anyone who has the solution? I'm stuck.
The error is located in the first paragraph, thank you.
Configuration: Windows / Chrome 96.0.4664.93
Is there anyone who has the solution? I'm stuck.
Private Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As StringPtr, ByVal lpWindowName As StringPtr) As Long Private Declare PtrSafe Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As LongPtr, ByVal nIndex As LongPtr) As Long Private Declare PtrSafe Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As LongPtr, ByVal nIndex As LongPtr, ByVal dwNewLong As LongPtr) As Long Private Declare PtrSafe Function DrawMenuBar Lib "user32" (ByVal hWnd As LongPtr) As Long Private Sub UserForm_Initialize() On Error Resume Next Dim hWnd As Long, Style As Long hWnd = FindWindow(vbNullString, Me.Caption) Style = GetWindowLong(hWnd, -16) And Not &HC00000 SetWindowLong hWnd, -16, Style DrawMenuBar hWnd End Sub
The error is located in the first paragraph, thank you.
Configuration: Windows / Chrome 96.0.4664.93
| EDIT: Added the code tags (syntax highlighting). Explanations available here: HERE Please keep this in mind in your future messages. |
2 answers
-
yg_be Posted messages 23437 Registration date Status Contributor Last intervention Ambassadeur 1 588
Hello,
the first thing is to determine what type it is.
replace the types with long to detect which one is causing the issue. -
Yes, but I learn very quickly :-), so in the meantime I managed to solve the problem, I identified the non-essential lines, I removed the components and no more issues,
thank you very much for your help and have a good evening.