tcunard Posted April 18, 2004 Share Posted April 18, 2004 How do I use a macro with FileOpen? FileOpen (@MyDocumentsDir &"\FSRPrt.xls") Tried mutiple variations of above but, can't get it to work. Link to comment Share on other sites More sharing options...
CyberSlug Posted April 19, 2004 Share Posted April 19, 2004 Debug time.... $path = @MyDocumentsDir & "FSRPrt.xls" MsgBox(0,"Checking macro:", @MyDocumentsDir) MsgBox(0,"Does file exist?", FileExists($path)) MsgBox(0,"Can it be read", FileOpen($path, 0)) First one fails if result it empty string Second one fails is result is 0 Third fails if result is -1 Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
tcunard Posted April 21, 2004 Author Share Posted April 21, 2004 Ok, that seems to work, but it wont open the file. ?? Man I miss the old Autoit Link to comment Share on other sites More sharing options...
Josbe Posted April 21, 2004 Share Posted April 21, 2004 Remember, FileOpen, open ASCII files (also binary like *.xls, but not is readable).If you want open this file with Excel (not read the binary text), then simplyuse: Run(@COMSPEC ' /c Start ' & @MyDocumentsDir & '\FSRPrt.xls', '', @SW_HIDE)-------------------------------------Taked from the Docs (FAQ)6. Why can I only use Run() to execute .exe files? What about .msi / .txt and others?Only a few file extensions are usually "runable" - these are .exe, .bat, .com, .pif. Other file types like .txt and .msi are actually executed with another program. When you double click on a "myfile.msi" file what actually happens in the background is that "msiexec.exe myfile.msi" is executed. So to run a .msi file from AutoIt you would do: RunWait("msiexec myfile.msi") Or, an even simpler way is to run the command "start" which will automatically work out how to execute the file for you: RunWait(@COMSPEC " /c Start myfile.msi") AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta 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