_Excel_RangeWrite won't write large strings

13 posts in this topic

KEHT 0

I've ran into a little problem that I don't know how to solve. I am creating a 2-dimensional string array. Some of the strings are somewhat large. What I have noticed is that function _Excel_RangeWrite will not write an array where there's a string that exceeds 250+ characters. I have ran into a similar problem when trying to do a replace on a Word document. The workaround was to put a value on clipboard and then paste it. I am fairly new to AutoIT and with a 2-d array I can't quite grasp how to proceed or whether it will even work. Here is a code that I have, that won't put data in an Excel sheet. If you shorten a first member of an $asActs array until the word "period", it will. Any help and workaround is appreciated. Thanks!

Share this post

Link to post

Share on other sites

BrewManNH 1,027

Try using _Excel_RangeWrite with the $bForceFunc set to true, it works when using the _ArrayTranspose function but doesn't when using the $oExcel.Transpose method.

1 person likes this

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Share this post

Link to post

Share on other sites

BrewManNH 1,027

I'm guessing there's a limit on the amount of characters the .Transpose method can handle.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Share this post

Link to post

Share on other sites

iamtheky 678

Would it be possible to get a specific error code when transpose fails? Such that if I am doing this in a loop I could specify, "If this error then try again with the transpose flag set", or is there a better check? As it stands now, anytime I am going to be reading an excel document, of which i do not know the contents, I have to run it with that flag set. For me, that is like 95% of time.

Share on other sites

KEHT 0

So, @error = 4 is exclusively for Transpose method or it is rather generic for "other" writing errors? Help files don't specify. I guess I should've finished reading the function help, but it just didn't occur to me the whole Transpose business was relevant.

I would have to agree that it would help immensely, especially for a relative noob to the language like myself. I go by what debugger shows me and a meaning of errors due to lack of experience. The more specific the error message, the easier it is to identify a solution.