Problems with Excel

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Jerry Thomas
Macro Veteran
Posts: 267
Joined: Mon Sep 27, 2010 8:57 pm
Location: Seattle, WA

Problems with Excel

Post by Jerry Thomas » Mon Oct 18, 2010 11:09 pm

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?
Thanks,
Jerry

[email protected]

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Oct 19, 2010 8:03 am

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?

hagchr
Automation Wizard
Posts: 327
Joined: Mon Jul 05, 2010 7:53 am
Location: Stockholm, Sweden

Post by hagchr » Tue Oct 19, 2010 9:25 am

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).

Jerry Thomas
Macro Veteran
Posts: 267
Joined: Mon Sep 27, 2010 8:57 pm
Location: Seattle, WA

Post by Jerry Thomas » Tue Oct 19, 2010 2:25 pm

Here it is:

XLGetCell>xlBook,xlSheet,CurRow,FileNameCol,fileName
...
RunProgram>NotePad.exe %fileName%

Since there are spaces in some of the paths, I have also tried
RunProgram>NotePad.exe "%fileName%"
Thanks,
Jerry

[email protected]

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Oct 19, 2010 2:56 pm

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%|
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

hagchr
Automation Wizard
Posts: 327
Joined: Mon Jul 05, 2010 7:53 am
Location: Stockholm, Sweden

Post by hagchr » Tue Oct 19, 2010 3:13 pm

It may also help if you concatenate a " in the beginning and end of your path/file name on each row. (""""" & cellRC & """"") plus the trim mentioned above. (ie just create a second column and have MS run on that one).

Jerry Thomas
Macro Veteran
Posts: 267
Joined: Mon Sep 27, 2010 8:57 pm
Location: Seattle, WA

Post by Jerry Thomas » Tue Oct 19, 2010 3:26 pm

I had tried that, with no success.
Thanks,
Jerry

[email protected]

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Oct 19, 2010 3:33 pm

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:

Code: Select all

IfFileExists>filename
  MessageModal>it exist
Endif
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.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Jerry Thomas
Macro Veteran
Posts: 267
Joined: Mon Sep 27, 2010 8:57 pm
Location: Seattle, WA

Post by Jerry Thomas » Tue Oct 19, 2010 4:19 pm

It's official.
I am brain dead.

The list I had copied into Excel was different than what I was running in the txt file. (The txt file had additional info that I didn't want in Excel)

6 directories deep, etc.
...\Test Image\... ...\Test_Image\...!

My apologies and my thanks!
Thanks,
Jerry

[email protected]

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts