Code: Select all
#SingleInstance force ;{
#Persistent
#WinActivateForce
#NoEnv ;}
IfExist C:\Users\%A_UserName%\Desktop\File3.xlsx
{
Excel := ComObjCreate("Excel.Application")
Excel := ComObjActive("Excel.Application")
Excel.Workbooks.Open("C:\Users\%A_UserName%\Desktop\File3.xlsx")
}
IfNotExist C:\Users\%A_UserName%\Desktop\File3.xlsx
{
Excel := ComObjCreate("Excel.Application")
Excel.Workbooks.Add
Excel.ActiveWorkbook.SaveAs("C:\Users\%A_UserName%\Desktop\File3.xlsx")
}
Excel.Visible := true
KeyWait RShift, D
Excel.Quit
Excel.ActiveWorkbook.SaveAs("C:\Users\%A_UserName%\Desktop\File3.xlsx")
Seems not to work. I am doing this script to give it to some friends. Thats the reason I wanna use " %A_UserName% ". I am stuck with this, and I appreciate any help