Click here to Skip to main content
15,894,343 members
Home / Discussions / COM
   

COM

 
Questionprblem with cocreateinstance ....! Pin
Sakthiu9-Oct-06 1:19
Sakthiu9-Oct-06 1:19 
AnswerRe: prblem with cocreateinstance ....! Pin
prasad_som9-Oct-06 1:43
prasad_som9-Oct-06 1:43 
GeneralRe: prblem with cocreateinstance ....! Pin
Sakthiu9-Oct-06 1:51
Sakthiu9-Oct-06 1:51 
AnswerRe: prblem with cocreateinstance ....! Pin
Lim Bio Liong9-Oct-06 4:09
Lim Bio Liong9-Oct-06 4:09 
Questionsimulate draging a file (drag and drop) Pin
drax_08158-Oct-06 20:53
drax_08158-Oct-06 20:53 
QuestionException of com in web application Pin
King Shez8-Oct-06 20:19
King Shez8-Oct-06 20:19 
QuestionIssues with COM-WOW64 Pin
indranil_m7-Oct-06 15:50
indranil_m7-Oct-06 15:50 
QuestionExcel.Range.set_Value string length limitation [modified] - solved (kind of...) Pin
mikone6-Oct-06 1:36
mikone6-Oct-06 1:36 
Hey guys Smile | :)

My situation:

I started playing around with the excel object library in c# and became a bit confused when an error occured while trying to set the value of a specific range.

First I wanted to use a 2-dimensional array to fill the sheet with data in one step. But I had to break it down to more little parts (inserting row for row) in order to track down the source of this strange error.

When inserting row for row, i noticed some of them being inserted well and others were not.

The difference between the rows which were inserted without any error and those who weren't is the length of some strings which consist of more than 911 characters.
I already found out that inserting the single value into the cell works fine but as soon as i use an array to fill the sheet, it does not work anymore.

Now (and finally Wink | ;) ) my question:

Is there any way to fill a excel sheet with a 2-dimensional array which contains strings longer than 911 chars with the set_Value method of a range object?

And if not - do you know any kind of workaround except for truncating the string to 911 chars?

Google wasn't very helpful (or i did not search for the right subject) and i just found some fellows having the same problem without any solution...

Thanks in advance,
mik


//edit:
I spent some more time in searching for a solution and found the following knowledge base article:
You may receive a "Run-time error 1004" error message when you programmatically set a large array string to a range in Excel 2003

I really don't want to believe that this actually is THE workaround - i even think its not a workaround at all. I would be glad to see a real workaround for this problem...


//second edit:
After googling like i never did before i found a google group post where a nice guy describes how to read a adodb recordset and fill the excel sheet with its data by using a QueryTable object. You also can use this to parse (tab-seperated) textfiles.
Here's the link - just check out the MSDN documentation for the different classes if you dont understand something (though QueryTable Class is barely documented...) -
Fill a Excelsheet with a QueryTable to work around the 911 character limitation



-- modified at 10:44 Monday 9th October, 2006
QuestionNew method problem Pin
prasad_som5-Oct-06 5:00
prasad_som5-Oct-06 5:00 
AnswerRe: New method problem Pin
Roger Stoltz5-Oct-06 23:17
Roger Stoltz5-Oct-06 23:17 
GeneralRe: New method problem Pin
prasad_som5-Oct-06 23:26
prasad_som5-Oct-06 23:26 
QuestionRe: New method problem Pin
Roger Stoltz5-Oct-06 23:59
Roger Stoltz5-Oct-06 23:59 
AnswerRe: New method problem Pin
prasad_som6-Oct-06 0:11
prasad_som6-Oct-06 0:11 
GeneralRe: New method problem Pin
Roger Stoltz6-Oct-06 2:29
Roger Stoltz6-Oct-06 2:29 
GeneralRe: New method problem Pin
prasad_som6-Oct-06 2:41
prasad_som6-Oct-06 2:41 
GeneralRe: New method problem Pin
Roger Stoltz6-Oct-06 4:48
Roger Stoltz6-Oct-06 4:48 
GeneralRe: New method problem Pin
prasad_som6-Oct-06 19:43
prasad_som6-Oct-06 19:43 
AnswerRe: New method problem Pin
prasad_som7-Oct-06 19:04
prasad_som7-Oct-06 19:04 
QuestionError tracing problem Pin
Radu Sorin5-Oct-06 3:45
Radu Sorin5-Oct-06 3:45 
QuestionATL property in OCX Control (MFC) Pin
AntonioKeh5-Oct-06 1:02
AntonioKeh5-Oct-06 1:02 
QuestionProblem in using com (not have .h file) Pin
Manish_Home4-Oct-06 20:31
Manish_Home4-Oct-06 20:31 
AnswerRe: Problem in using com (not have .h file) Pin
Steve S4-Oct-06 22:11
Steve S4-Oct-06 22:11 
GeneralRe: Problem in using com (not have .h file) Pin
Manish_Home6-Oct-06 0:29
Manish_Home6-Oct-06 0:29 
GeneralRe: Problem in using com (not have .h file) Pin
prasad_som6-Oct-06 0:38
prasad_som6-Oct-06 0:38 
GeneralRe: Problem in using com (not have .h file) Pin
Manish_Home8-Oct-06 22:26
Manish_Home8-Oct-06 22:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.