Our work upgraded to Microsoft 365 and this has affected a macro that was run on 32,
Here is the original macro
Here is the original macro
VBA Code:
' 5/1/2013 .:\L0sT/:.
Private Declare Function GetUserName Lib "advapi32.dll" _
Alias "GetUserNameA" _
(ByVal lpBuffer As String, _
ByRef nSize As Long) As Long
And this is what i changed it to
' 5/1/2013 .:\L0sT/:.
Private Declare PtrSafe Function GetUserName Lib "advapi32.dll" _
Alias "GetUserNameA" _
(ByVal lpBuffer As String, _
ByRef nSize As Long) As LongPtr
Also tried this
' 5/1/2013 .:\L0sT/:.
Private Declare PtrSafe Function GetUserName Lib "advapi32.dll" _
Alias "GetUserNameA" _
(ByVal lpBuffer As String, _
ByRef nSize As Long) As Long
The macro will start to run then eventually close out the excel program. What am I missing. Thank you all for your help.
Also does this need to be changed as well for everything to work
' 5/1/2013 .:\L0sT/:.
Sub Clear_Temp_Files()
Shell "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8 "
End Sub
Sub Clear_Cookies()
Shell "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2"
End Sub
Sub Clear_History()
Shell "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1"
End Sub
Sub Clear_Form_Data()
Shell "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16"
End Sub
Sub Clear_Saved_Passwords()
Shell "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32"
End Sub
Sub Clear_All()
Shell "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255"
End Sub
Sub Clear_Clear_Add_ons_Settings()
Shell "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351"
End Sub
Sub Clear_4_Tool()
'
Clear_Temp_Files
Clear_Cookies
Clear_History
End Sub
Last edited by a moderator: