Tell it to write X and it puts a 0

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Shadow3641
Junior Coder
Posts: 26
Joined: Thu Nov 17, 2016 2:45 pm

Tell it to write X and it puts a 0

Post by Shadow3641 » Thu Mar 30, 2017 1:19 pm

I have a backup program running and I use a excel sheet to track the progress of it in case it gets interrupted I can just restart and it will pick up where it left off. I'm using this bit of code to write to a cell in the spreadsheet the problem is that i'm telling it to write a X and its putting a 0 instead any ideas? at the end of the program it resets all the cells with a Y to set it up for the next time this part works fine.

Code: Select all

  XLOpen>%USERDOCUMENTS_DIR%\BackupArray.xls,0,xlBook
  XLSetCell>xlBook,Sheet1,%Loop%,6,X,res
  XLSave>xlBook,%USERDOCUMENTS_DIR%\BackupArray.xls
  XLQuit>xlBook
Thanks for any help

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

Re: Tell it to write X and it puts a 0

Post by hagchr » Thu Mar 30, 2017 2:20 pm

Maybe you are using x as a variable somewhere in the code and it has a value of 0 when you write to the file.

Shadow3641
Junior Coder
Posts: 26
Joined: Thu Nov 17, 2016 2:45 pm

Re: Tell it to write X and it puts a 0

Post by Shadow3641 » Thu Mar 30, 2017 2:30 pm

I searched all through my code and i'm not writing to a var X. I think i'm just going to write a 1 or 0 in that block instead of a X and Y and give it a shot

mightycpa
Automation Wizard
Posts: 343
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Re: Tell it to write X and it puts a 0

Post by mightycpa » Thu Mar 30, 2017 2:55 pm

Maybe you've unwittingly written a TIC-TAC-TOE bot. :D

Have you tried putting an apostrophe in front of that X?

I noticed one in the documentation example, and of course, that's excel's clue that you're using text.

XLSetCell>xlBook,Sheet1,2,2,'205,res
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

Shadow3641
Junior Coder
Posts: 26
Joined: Thu Nov 17, 2016 2:45 pm

Re: Tell it to write X and it puts a 0

Post by Shadow3641 » Thu Mar 30, 2017 6:46 pm

Yep for some reason that worked Don't know why it did that It was working perfectly fine then i added one section to it and it started to flip out. Thanks for the help

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