rygaar Posted July 21, 2012 Report Share Posted July 21, 2012 In my macro I am trying to copy the contents of a cell from Excel (the location fo a file on disk), and then open the file. Sounds simple enough but this is my first ever macro, so I am doing something wrong and have no idea what. Below are the lines from Script Editor: > Text Type (Simulate Keystrokes): <DOWN ARROW> > Clipboard Copy > Variable Set String %filepath% from the clipboard contents > Program Launch: "%filepath%" (Normal) Parameters: I get the error "The file could not be located "_filepath_" at the last line above. I know that the filepath is correct because if I adjust the macro to open the Run window (<Win>r), paste the clipboard contents and press <ENTER>, the file is loaded. The problem is that this workaround doesn't work everytime, so the macro fails from time to time. How can I open the file directly from within the macro? please help. -Patrick Quote Link to comment Share on other sites More sharing options...
Cory Posted July 22, 2012 Report Share Posted July 22, 2012 Excel will put EoL (End of Line) characters at the end of the text string. Use the Trim command on that variable after you copy it from Excel. This will remove all invisible characters. If you have a list you might consider saving it to a text file and using the Text File Process command instead. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.