When pressing the macro, it comes up with a Compile error: Wrong number of arguments or invalid property assignment. I finally got it to slightly work for 64bit, but now am running into this issue.
Private Function getUser() As String
Dim strUser As String
'Create a buffer
strUser = String(100, Chr(0))
'Get the username
getUser strUser, 100
'strip the rest of the buffer
strUser = Left(strUser, InStr(strUser, Chr(0)) - 1)
getUser = strUser
End Function
Here's the other one with getUser in it.
On Error Resume Next
Set MyOL = GetObject(, "Outlook.Application")
If MyOL Is Nothing Then
Set MyOL = CreateObject("Outlook.Application")
End If
strUser = getUser
Application.DisplayAlerts = False
ThisWorkbook.SaveAs "C:\Documents and Settings\" & strUser & "\Local Settings\Temp\" & " " & staffname & " - OT Survey for " & ActiveSheet.name & ".xlsm"
Application.DisplayAlerts = True