Vikramjeet Posted April 23, 2019 Share Posted April 23, 2019 #include-once #include <MsgBoxConstants.au3> #Include <File.au3> $oExcel = ObjCreate("Excel.Application") $oExcel.Visible = 0 HotKeySet("{DEL}", "ExitScript") Func ExitScript() $oExcel.Application.Quit MsgBox($MB_ICONERROR, "MESSAGE", 'PROCESS ABORTED') Exit EndFunc WinActivate("Application") Global $hWnd = WinWaitActive("Application", "", 5) $oExcel.Application.WorkBooks.Open("C:\Users\Charlie\Desktop\Data.xlsx") I do not have AutoIt installed on my machine. I am using the 'AutoIt– Self Extracting Archive' to execute my script. I am getting the below error when I execute the script. What am I missing Line 2 (File "C\Users\Charlie\Desktop\Script.au3"): #include <MsgBoxConstants.au3> Error:Error opening File Link to comment Share on other sites More sharing options...
abberration Posted April 23, 2019 Share Posted April 23, 2019 If you are running AutoIt from a zipped folder, then that's your problem. You need to extract all of the AutoIt files to a folder and run it from there. When you run something from a zipped folder, it only extracts the item you are running and all other files are still in the zipped folder. Therefore, the #include you referenced is not in the temp folder that your zip program created. Easy MP3 | Software Installer | Password Manager Link to comment Share on other sites More sharing options...
Vikramjeet Posted April 24, 2019 Author Share Posted April 24, 2019 Got it. It is working now. Thanks for your advice Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now