Problems with Excel
Moderators: JRL, Dorian (MJT support)
-
- Macro Veteran
- Posts: 267
- Joined: Mon Sep 27, 2010 8:57 pm
- Location: Seattle, WA
Problems with Excel
I have a list of files (~2000) that I am reading from a txt file. Then I log the results of my test to a different file.
I want to change this to use an Excel file to have the name, expected results and actual results together. Something like this:
Date........Exp....Rslt...File
10/18/10 PASS FAIL c:\user\Jerry\Documents\ABC 123.txt
When I read the name from the txt file everything works fine.
When I read from Excel, I get "File not found".
I have watched the variables, copied and pasted to Note pad and they appear to be the same regardless of the source.
I saw an earlier post about Excel includes CRLF, so I tried trimming any unseen characters. I have tried IGNORESPACES=1 and enclosing in " "s. File still not found.
Suggestions?
I want to change this to use an Excel file to have the name, expected results and actual results together. Something like this:
Date........Exp....Rslt...File
10/18/10 PASS FAIL c:\user\Jerry\Documents\ABC 123.txt
When I read the name from the txt file everything works fine.
When I read from Excel, I get "File not found".
I have watched the variables, copied and pasted to Note pad and they appear to be the same regardless of the source.
I saw an earlier post about Excel includes CRLF, so I tried trimming any unseen characters. I have tried IGNORESPACES=1 and enclosing in " "s. File still not found.
Suggestions?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
We can't see your code, so can't really offer any suggestions. We don't know how you are reading from Excel (VBScript/DDE/Native XL functions/something else?) Please post the code you are using to read from the Excel file as well as the subsequent code to open the text file and we'll do our best to help.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Not sure of your code, I tried a simple example where I have the file name (with path and proper extension) in one cell in excel and then copy it to the clipboard, then
GetClipBoard>test
wait>.2
RTrim>test,test
wait>.2
ExecuteFile>test
And it works fine on my machine (also tried different file types).
GetClipBoard>test
wait>.2
RTrim>test,test
wait>.2
ExecuteFile>test
And it works fine on my machine (also tried different file types).
-
- Macro Veteran
- Posts: 267
- Joined: Mon Sep 27, 2010 8:57 pm
- Location: Seattle, WA
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
What happens if you do:
XLGetCell>xlBook,xlSheet,CurRow,FileNameCol,fileName
...
Trim>fileName,fileName
RunProgram>NotePad.exe "%fileName%"
And what do you see (paste it here if you like) if you do:
XLGetCell>xlBook,xlSheet,CurRow,FileNameCol,fileName
MessageModal>|%fileName%|
XLGetCell>xlBook,xlSheet,CurRow,FileNameCol,fileName
...
Trim>fileName,fileName
RunProgram>NotePad.exe "%fileName%"
And what do you see (paste it here if you like) if you do:
XLGetCell>xlBook,xlSheet,CurRow,FileNameCol,fileName
MessageModal>|%fileName%|
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Macro Veteran
- Posts: 267
- Joined: Mon Sep 27, 2010 8:57 pm
- Location: Seattle, WA
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Well can you please send a sample of the data so that we can actually see what it looks like? We're all in the dark here. Copy it from the watch list or use my message box above.
What happens if you do:
How about you post your actual code and if so please insert it between textarea tags using the code button. That way we can see the raw code unmodified by html.
What happens if you do:
Code: Select all
IfFileExists>filename
MessageModal>it exist
Endif
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Macro Veteran
- Posts: 267
- Joined: Mon Sep 27, 2010 8:57 pm
- Location: Seattle, WA