Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[solved] Setcell won't work for me
#1
Hello,

Everything goes fine until SetSell at the end. It does nothing it seems. Syntax seems right. Please help.

Macro Macro2
Code:
Copy      Help
spe -1 ;;auto delay
str UniqueUrl
;ExcelSheet es.Init
ARRAY(str) ListOfData ListOfUrls
int r c

run "D:\0 documents\1.xlsx"
run "D:\0 documents\2.xlsx"


ExcelSheet ExcelFileData ExcelFileUrls
ExcelFileData.Init("" 8 "D:\0 documents\2.xlsx")
ExcelFileUrls.Init("" 8 "D:\0 documents\1.xlsx")



ExcelFileUrls.CellsToArray(ListOfUrls "A:A")
ExcelFileData.CellsToArray(ListOfData "A:A")

;

;;ouputs fine
for r 0 ListOfUrls.len
,out ListOfUrls[0 r]


;;fails
ExcelFileUrls.SetCell("asdfasdf" 1 1)
#2
Maybe need to call Save.
#3
Change this:
Code:
Copy      Help
ExcelFileData.Init("" 8 "D:\0 documents\2.xlsx")
ExcelFileUrls.Init("" 8 "D:\0 documents\1.xlsx")
to:
Code:
Copy      Help
ExcelFileData.Init("" 4 "D:\0 documents\2.xlsx")
ExcelFileUrls.Init("" 4 "D:\0 documents\1.xlsx")

and at the end use
Code:
Copy      Help
Urls.Save
to save the change(s).
#4
Thanks, Gintaras and Lion King.

Switching from 8 to 4 worked. I also commented out the run commands. See below for revised code.

Macro macro2

Code:
Copy      Help
;don't need
;run "D:\0 documents\1.xlsx"
;run "D:\0 documents\2.xlsx"

ExcelSheet ExcelFileData ExcelFileUrls
ExcelFileData.Init("" 4 "D:\0 documents\2.xlsx")
ExcelFileUrls.Init("" 4 "D:\0 documents\1.xlsx")


Forum Jump:


Users browsing this thread: 1 Guest(s)