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 réponses
yg_be
Posted messages
23437
Registration date
Status
Contributeur
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.
the first thing is to determine what type it is.
replace the types with long to detect which one is causing the issue.
The types are already in long format, I don't see what type it is?
I'm a novice when it comes to overly complex macros.
You are a beginner and you wrote this relatively complex macro?