Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[solved] icsv - v.Cell - breaks after 10 loops
#1
Hi,

I'm trying to write some text to a csv file. The code works...only up to around 10 times. Once rowpos = 10 or so, I get this error on the line indicated below...

Error (RT) in write comments to csv file: 0x80070057, The parameter is incorrect. ?


Macro write comments to csv file
Code:
Copy      Help
int i
int rowpos
str tempstr
spe

Acc a.Find(w "PUSHBUTTON" "[]View" "class=*.Window.*[]wfName=ribbonBarWriteView" 0x1005)
a.DoDefaultAction

for rowpos 0 50
,a.Find(w "PUSHBUTTON" "[]View" "class=*.Window.*[]wfName=ribbonBarWriteView" 0x1005)
,a.DoDefaultAction
,
,'Ca
,tempstr.getsel
,tempstr.findreplace("<p>" "")
,tempstr.findreplace("</p>" "[]")
,tempstr.findreplace("<br />" "")
,
,v.Cell(rowpos 0)= tempstr   ;;<-------------- keeps breaking here after when rowpos is about 10

v.ToFile("c:\test\test.csv")
#2
Hi Gintaras,

I'm still stuck on this problem. Please help when you get a chance.
#3
To debug, insert this line before.
,out F"{rowpos} {v.RowCount}"
#4
I ran it with your code and I got this

9 9

ps. here's how I did it

Macro write comments to csv file
Code:
Copy      Help
,out F"{rowpos} {v.RowCount}"
,v.Cell(rowpos 0)=tempstr  ;;<-------- this is the problem! ONLY this "Error (RT) in write comments to csv file:  0x80070057, The parameter is incorrect.    ? " it seems like once it reaches double digits it dies
,out F"---------------------{rowpos}"
,out v.Cell(rowpos 0)
#5
Hi,

in the other thread you said, I solved it? "incorrect row index."

lol

I'm sorry, but I'm lost. All I know is that's the output ( 9 9) I got from the code that you gave me.

I don't know understand why it breaks after this. In other words, I don't know why I can't write more than 10 rows.

What do I need to do to make it work?
#6
Add 50 rows. Or stop setting cell values when rowpos becomes = v.RowCount.
#7
Thanks for that. It works fine now.


Forum Jump:


Users browsing this thread: 1 Guest(s)