![]() |
OpenText Method failure
I am trying to open a text report-type document and put it into an excel
spreadsheet. To prototype my command, I tested the following statement: Excel.Workbooks.OpenText FileName:=sAttachPath & "\" & EMAttachment, fieldinfo:=Array(Array(0, 1), Array(13, 1), Array(23, 1), Array(39, 1), Array(70, 1), Array(75, 1), Array(83, 1), Array(94, 1)) .... which works very well. But when I try to make it customizable, I tested the following statement: Excel.Workbooks.OpenText FileName:=sAttachPath & "\" & EMAttachment, fieldinfo:=sFieldInfo .... where sFieldInfo is set to "Array(Array(0, 1), Array(13, 1), Array(23, 1), Array(39, 1), Array(70, 1), Array(75, 1), Array(83, 1), Array(94, 1))", I get the error that I put in the Subject of this post. Anyone got any ideas?? Seems kinda' strange. TIA!! Bryan |
OpenText Method failure
so you set sFieldInfo like this
Dim sFieldInfo as Variant sFieldInfo = Array(Array(0, 1), Array(13, 1), Array(23,1), _ Array(39, 1), Array(70, 1), Array(75, 1), _ Array(83, 1), Array(94, 1)) If not, that is probably your problem. -- Regards, Tom Ogilvy "Bryan Dickerson" wrote in message ... I am trying to open a text report-type document and put it into an excel spreadsheet. To prototype my command, I tested the following statement: Excel.Workbooks.OpenText FileName:=sAttachPath & "\" & EMAttachment, fieldinfo:=Array(Array(0, 1), Array(13, 1), Array(23, 1), Array(39, 1), Array(70, 1), Array(75, 1), Array(83, 1), Array(94, 1)) ... which works very well. But when I try to make it customizable, I tested the following statement: Excel.Workbooks.OpenText FileName:=sAttachPath & "\" & EMAttachment, fieldinfo:=sFieldInfo ... where sFieldInfo is set to "Array(Array(0, 1), Array(13, 1), Array(23, 1), Array(39, 1), Array(70, 1), Array(75, 1), Array(83, 1), Array(94, 1))", I get the error that I put in the Subject of this post. Anyone got any ideas?? Seems kinda' strange. TIA!! Bryan |
OpenText Method failure
Just a guess by the name of sFieldInfo...
I'm guessing you did something like: dim sFieldInfo as string sFieldInfo = "Array(Array(0, 1), Array(13, 1)," _ & "Array(23, 1), Array(39, 1), Array(70, 1)," _ & "Array(75, 1), Array(83, 1), Array(94, 1))" ..Opentext's fieldinfo is expecting a real array--not just a string. Maybe something like: dim vFieldInfo as Variant 'name changed! vFieldInfo = Array(Array(0, 1), Array(13, 1), _ Array(23, 1), Array(39, 1), Array(70, 1), _ Array(75, 1), Array(83, 1), Array(94, 1)) (vFieldInfo is now a variant that contains an array of arrays--it's not a string value.) ======= Here's a nice reference for a problem that sometimes comes up with .opentext: http://support.microsoft.com/default...EN-US;q134826& XL: "Out of Memory" Message Using the OpenText Method You may like it just to see another way. Bryan Dickerson wrote: I am trying to open a text report-type document and put it into an excel spreadsheet. To prototype my command, I tested the following statement: Excel.Workbooks.OpenText FileName:=sAttachPath & "\" & EMAttachment, fieldinfo:=Array(Array(0, 1), Array(13, 1), Array(23, 1), Array(39, 1), Array(70, 1), Array(75, 1), Array(83, 1), Array(94, 1)) ... which works very well. But when I try to make it customizable, I tested the following statement: Excel.Workbooks.OpenText FileName:=sAttachPath & "\" & EMAttachment, fieldinfo:=sFieldInfo ... where sFieldInfo is set to "Array(Array(0, 1), Array(13, 1), Array(23, 1), Array(39, 1), Array(70, 1), Array(75, 1), Array(83, 1), Array(94, 1))", I get the error that I put in the Subject of this post. Anyone got any ideas?? Seems kinda' strange. TIA!! Bryan -- Dave Peterson |
OpenText Method failure
No it's more like:
Dim sFieldInfo as String sFieldInfo = "Array(Array(0, 1), Array(13, 1), Array(23,1), Array(39, 1), Array(70, 1), Array(75, 1), Array(83, 1), Array(94,1))" The string is actually created from a set of values that are read from somewhere else, but ultimately that's what sFieldInfo looks like right before it's used in the OpenText method. BTW, I wouldn't think that this makes a difference, but this is actually running from a VB6 program. "Tom Ogilvy" wrote in message ... so you set sFieldInfo like this Dim sFieldInfo as Variant sFieldInfo = Array(Array(0, 1), Array(13, 1), Array(23,1), _ Array(39, 1), Array(70, 1), Array(75, 1), _ Array(83, 1), Array(94, 1)) If not, that is probably your problem. -- Regards, Tom Ogilvy "Bryan Dickerson" wrote in message ... I am trying to open a text report-type document and put it into an excel spreadsheet. To prototype my command, I tested the following statement: Excel.Workbooks.OpenText FileName:=sAttachPath & "\" & EMAttachment, fieldinfo:=Array(Array(0, 1), Array(13, 1), Array(23, 1), Array(39, 1), Array(70, 1), Array(75, 1), Array(83, 1), Array(94, 1)) ... which works very well. But when I try to make it customizable, I tested the following statement: Excel.Workbooks.OpenText FileName:=sAttachPath & "\" & EMAttachment, fieldinfo:=sFieldInfo ... where sFieldInfo is set to "Array(Array(0, 1), Array(13, 1), Array(23, 1), Array(39, 1), Array(70, 1), Array(75, 1), Array(83, 1), Array(94, 1))", I get the error that I put in the Subject of this post. Anyone got any ideas?? Seems kinda' strange. TIA!! Bryan |
OpenText Method failure
The argument isn't looking for a string, it is looking for an array of
arrays - so, as I said, if it doesn't look like what i showed you, that is your problem. -- Regards, Tom Ogilvy "Bryan Dickerson" wrote in message ... No it's more like: Dim sFieldInfo as String sFieldInfo = "Array(Array(0, 1), Array(13, 1), Array(23,1), Array(39, 1), Array(70, 1), Array(75, 1), Array(83, 1), Array(94,1))" The string is actually created from a set of values that are read from somewhere else, but ultimately that's what sFieldInfo looks like right before it's used in the OpenText method. BTW, I wouldn't think that this makes a difference, but this is actually running from a VB6 program. "Tom Ogilvy" wrote in message ... so you set sFieldInfo like this Dim sFieldInfo as Variant sFieldInfo = Array(Array(0, 1), Array(13, 1), Array(23,1), _ Array(39, 1), Array(70, 1), Array(75, 1), _ Array(83, 1), Array(94, 1)) If not, that is probably your problem. -- Regards, Tom Ogilvy "Bryan Dickerson" wrote in message ... I am trying to open a text report-type document and put it into an excel spreadsheet. To prototype my command, I tested the following statement: Excel.Workbooks.OpenText FileName:=sAttachPath & "\" & EMAttachment, fieldinfo:=Array(Array(0, 1), Array(13, 1), Array(23, 1), Array(39, 1), Array(70, 1), Array(75, 1), Array(83, 1), Array(94, 1)) ... which works very well. But when I try to make it customizable, I tested the following statement: Excel.Workbooks.OpenText FileName:=sAttachPath & "\" & EMAttachment, fieldinfo:=sFieldInfo ... where sFieldInfo is set to "Array(Array(0, 1), Array(13, 1), Array(23, 1), Array(39, 1), Array(70, 1), Array(75, 1), Array(83, 1), Array(94, 1))", I get the error that I put in the Subject of this post. Anyone got any ideas?? Seems kinda' strange. TIA!! Bryan |
OpenText Method failure
Ok, so am I screwed if I'm reading the numbers from somewhere else? 'Cause
the way I figure it, I'm reading the values in thru db record value that has, e.g., "1;14;24;..." in it. In my code, I'm taking those values, separating them and then trying to create the string that duplicates that parm "FieldInfo:=Array(Array(0, 1), Array(13, 1), ..." So I've got to find some way (and I don't think there is one, but please correct me if I'm wrong), to create code on the fly and get it to be interpreted. "Dave Peterson" wrote in message ... Just a guess by the name of sFieldInfo... I'm guessing you did something like: dim sFieldInfo as string sFieldInfo = "Array(Array(0, 1), Array(13, 1)," _ & "Array(23, 1), Array(39, 1), Array(70, 1)," _ & "Array(75, 1), Array(83, 1), Array(94, 1))" .Opentext's fieldinfo is expecting a real array--not just a string. Maybe something like: dim vFieldInfo as Variant 'name changed! vFieldInfo = Array(Array(0, 1), Array(13, 1), _ Array(23, 1), Array(39, 1), Array(70, 1), _ Array(75, 1), Array(83, 1), Array(94, 1)) (vFieldInfo is now a variant that contains an array of arrays--it's not a string value.) ======= Here's a nice reference for a problem that sometimes comes up with .opentext: http://support.microsoft.com/default...EN-US;q134826& XL: "Out of Memory" Message Using the OpenText Method You may like it just to see another way. Bryan Dickerson wrote: I am trying to open a text report-type document and put it into an excel spreadsheet. To prototype my command, I tested the following statement: Excel.Workbooks.OpenText FileName:=sAttachPath & "\" & EMAttachment, fieldinfo:=Array(Array(0, 1), Array(13, 1), Array(23, 1), Array(39, 1), Array(70, 1), Array(75, 1), Array(83, 1), Array(94, 1)) ... which works very well. But when I try to make it customizable, I tested the following statement: Excel.Workbooks.OpenText FileName:=sAttachPath & "\" & EMAttachment, fieldinfo:=sFieldInfo ... where sFieldInfo is set to "Array(Array(0, 1), Array(13, 1), Array(23, 1), Array(39, 1), Array(70, 1), Array(75, 1), Array(83, 1), Array(94, 1))", I get the error that I put in the Subject of this post. Anyone got any ideas?? Seems kinda' strange. TIA!! Bryan -- Dave Peterson |
OpenText Method failure
Read the "nice" article Dave posted. In that article, they create it on
the fly. If you have the information to build the string, you have the information to build the array. -- Regards, Tom Ogilvy "Bryan Dickerson" wrote in message ... Ok, so am I screwed if I'm reading the numbers from somewhere else? 'Cause the way I figure it, I'm reading the values in thru db record value that has, e.g., "1;14;24;..." in it. In my code, I'm taking those values, separating them and then trying to create the string that duplicates that parm "FieldInfo:=Array(Array(0, 1), Array(13, 1), ..." So I've got to find some way (and I don't think there is one, but please correct me if I'm wrong), to create code on the fly and get it to be interpreted. "Dave Peterson" wrote in message ... Just a guess by the name of sFieldInfo... I'm guessing you did something like: dim sFieldInfo as string sFieldInfo = "Array(Array(0, 1), Array(13, 1)," _ & "Array(23, 1), Array(39, 1), Array(70, 1)," _ & "Array(75, 1), Array(83, 1), Array(94, 1))" .Opentext's fieldinfo is expecting a real array--not just a string. Maybe something like: dim vFieldInfo as Variant 'name changed! vFieldInfo = Array(Array(0, 1), Array(13, 1), _ Array(23, 1), Array(39, 1), Array(70, 1), _ Array(75, 1), Array(83, 1), Array(94, 1)) (vFieldInfo is now a variant that contains an array of arrays--it's not a string value.) ======= Here's a nice reference for a problem that sometimes comes up with .opentext: http://support.microsoft.com/default...EN-US;q134826& XL: "Out of Memory" Message Using the OpenText Method You may like it just to see another way. Bryan Dickerson wrote: I am trying to open a text report-type document and put it into an excel spreadsheet. To prototype my command, I tested the following statement: Excel.Workbooks.OpenText FileName:=sAttachPath & "\" & EMAttachment, fieldinfo:=Array(Array(0, 1), Array(13, 1), Array(23, 1), Array(39, 1), Array(70, 1), Array(75, 1), Array(83, 1), Array(94, 1)) ... which works very well. But when I try to make it customizable, I tested the following statement: Excel.Workbooks.OpenText FileName:=sAttachPath & "\" & EMAttachment, fieldinfo:=sFieldInfo ... where sFieldInfo is set to "Array(Array(0, 1), Array(13, 1), Array(23, 1), Array(39, 1), Array(70, 1), Array(75, 1), Array(83, 1), Array(94, 1))", I get the error that I put in the Subject of this post. Anyone got any ideas?? Seems kinda' strange. TIA!! Bryan -- Dave Peterson |
OpenText Method failure
Very interesting. Thanx! Oh, and thanx to you, too, Dave. Next time I'll
read the WHOLE article! "Tom Ogilvy" wrote in message ... Read the "nice" article Dave posted. In that article, they create it on the fly. If you have the information to build the string, you have the information to build the array. -- Regards, Tom Ogilvy "Bryan Dickerson" wrote in message ... Ok, so am I screwed if I'm reading the numbers from somewhere else? 'Cause the way I figure it, I'm reading the values in thru db record value that has, e.g., "1;14;24;..." in it. In my code, I'm taking those values, separating them and then trying to create the string that duplicates that parm "FieldInfo:=Array(Array(0, 1), Array(13, 1), ..." So I've got to find some way (and I don't think there is one, but please correct me if I'm wrong), to create code on the fly and get it to be interpreted. "Dave Peterson" wrote in message ... Just a guess by the name of sFieldInfo... I'm guessing you did something like: dim sFieldInfo as string sFieldInfo = "Array(Array(0, 1), Array(13, 1)," _ & "Array(23, 1), Array(39, 1), Array(70, 1)," _ & "Array(75, 1), Array(83, 1), Array(94, 1))" .Opentext's fieldinfo is expecting a real array--not just a string. Maybe something like: dim vFieldInfo as Variant 'name changed! vFieldInfo = Array(Array(0, 1), Array(13, 1), _ Array(23, 1), Array(39, 1), Array(70, 1), _ Array(75, 1), Array(83, 1), Array(94, 1)) (vFieldInfo is now a variant that contains an array of arrays--it's not a string value.) ======= Here's a nice reference for a problem that sometimes comes up with .opentext: http://support.microsoft.com/default...EN-US;q134826& XL: "Out of Memory" Message Using the OpenText Method You may like it just to see another way. Bryan Dickerson wrote: I am trying to open a text report-type document and put it into an excel spreadsheet. To prototype my command, I tested the following statement: Excel.Workbooks.OpenText FileName:=sAttachPath & "\" & EMAttachment, fieldinfo:=Array(Array(0, 1), Array(13, 1), Array(23, 1), Array(39, 1), Array(70, 1), Array(75, 1), Array(83, 1), Array(94, 1)) ... which works very well. But when I try to make it customizable, I tested the following statement: Excel.Workbooks.OpenText FileName:=sAttachPath & "\" & EMAttachment, fieldinfo:=sFieldInfo ... where sFieldInfo is set to "Array(Array(0, 1), Array(13, 1), Array(23, 1), Array(39, 1), Array(70, 1), Array(75, 1), Array(83, 1), Array(94, 1))", I get the error that I put in the Subject of this post. Anyone got any ideas?? Seems kinda' strange. TIA!! Bryan -- Dave Peterson |
OpenText Method failure
Good news: It works! Amazing what happens when you just read the
instructions, huh?? "Bryan Dickerson" wrote in message ... Very interesting. Thanx! Oh, and thanx to you, too, Dave. Next time I'll read the WHOLE article! "Tom Ogilvy" wrote in message ... Read the "nice" article Dave posted. In that article, they create it on the fly. If you have the information to build the string, you have the information to build the array. -- Regards, Tom Ogilvy "Bryan Dickerson" wrote in message ... Ok, so am I screwed if I'm reading the numbers from somewhere else? 'Cause the way I figure it, I'm reading the values in thru db record value that has, e.g., "1;14;24;..." in it. In my code, I'm taking those values, separating them and then trying to create the string that duplicates that parm "FieldInfo:=Array(Array(0, 1), Array(13, 1), ..." So I've got to find some way (and I don't think there is one, but please correct me if I'm wrong), to create code on the fly and get it to be interpreted. "Dave Peterson" wrote in message ... Just a guess by the name of sFieldInfo... I'm guessing you did something like: dim sFieldInfo as string sFieldInfo = "Array(Array(0, 1), Array(13, 1)," _ & "Array(23, 1), Array(39, 1), Array(70, 1)," _ & "Array(75, 1), Array(83, 1), Array(94, 1))" .Opentext's fieldinfo is expecting a real array--not just a string. Maybe something like: dim vFieldInfo as Variant 'name changed! vFieldInfo = Array(Array(0, 1), Array(13, 1), _ Array(23, 1), Array(39, 1), Array(70, 1), _ Array(75, 1), Array(83, 1), Array(94, 1)) (vFieldInfo is now a variant that contains an array of arrays--it's not a string value.) ======= Here's a nice reference for a problem that sometimes comes up with .opentext: http://support.microsoft.com/default...EN-US;q134826& XL: "Out of Memory" Message Using the OpenText Method You may like it just to see another way. Bryan Dickerson wrote: I am trying to open a text report-type document and put it into an excel spreadsheet. To prototype my command, I tested the following statement: Excel.Workbooks.OpenText FileName:=sAttachPath & "\" & EMAttachment, fieldinfo:=Array(Array(0, 1), Array(13, 1), Array(23, 1), Array(39, 1), Array(70, 1), Array(75, 1), Array(83, 1), Array(94, 1)) ... which works very well. But when I try to make it customizable, I tested the following statement: Excel.Workbooks.OpenText FileName:=sAttachPath & "\" & EMAttachment, fieldinfo:=sFieldInfo ... where sFieldInfo is set to "Array(Array(0, 1), Array(13, 1), Array(23, 1), Array(39, 1), Array(70, 1), Array(75, 1), Array(83, 1), Array(94, 1))", I get the error that I put in the Subject of this post. Anyone got any ideas?? Seems kinda' strange. TIA!! Bryan -- Dave Peterson |
OpenText Method failure
Woohoo!!!
Bryan Dickerson wrote: Good news: It works! Amazing what happens when you just read the instructions, huh?? "Bryan Dickerson" wrote in message ... Very interesting. Thanx! Oh, and thanx to you, too, Dave. Next time I'll read the WHOLE article! "Tom Ogilvy" wrote in message ... Read the "nice" article Dave posted. In that article, they create it on the fly. If you have the information to build the string, you have the information to build the array. -- Regards, Tom Ogilvy "Bryan Dickerson" wrote in message ... Ok, so am I screwed if I'm reading the numbers from somewhere else? 'Cause the way I figure it, I'm reading the values in thru db record value that has, e.g., "1;14;24;..." in it. In my code, I'm taking those values, separating them and then trying to create the string that duplicates that parm "FieldInfo:=Array(Array(0, 1), Array(13, 1), ..." So I've got to find some way (and I don't think there is one, but please correct me if I'm wrong), to create code on the fly and get it to be interpreted. "Dave Peterson" wrote in message ... Just a guess by the name of sFieldInfo... I'm guessing you did something like: dim sFieldInfo as string sFieldInfo = "Array(Array(0, 1), Array(13, 1)," _ & "Array(23, 1), Array(39, 1), Array(70, 1)," _ & "Array(75, 1), Array(83, 1), Array(94, 1))" .Opentext's fieldinfo is expecting a real array--not just a string. Maybe something like: dim vFieldInfo as Variant 'name changed! vFieldInfo = Array(Array(0, 1), Array(13, 1), _ Array(23, 1), Array(39, 1), Array(70, 1), _ Array(75, 1), Array(83, 1), Array(94, 1)) (vFieldInfo is now a variant that contains an array of arrays--it's not a string value.) ======= Here's a nice reference for a problem that sometimes comes up with .opentext: http://support.microsoft.com/default...EN-US;q134826& XL: "Out of Memory" Message Using the OpenText Method You may like it just to see another way. Bryan Dickerson wrote: I am trying to open a text report-type document and put it into an excel spreadsheet. To prototype my command, I tested the following statement: Excel.Workbooks.OpenText FileName:=sAttachPath & "\" & EMAttachment, fieldinfo:=Array(Array(0, 1), Array(13, 1), Array(23, 1), Array(39, 1), Array(70, 1), Array(75, 1), Array(83, 1), Array(94, 1)) ... which works very well. But when I try to make it customizable, I tested the following statement: Excel.Workbooks.OpenText FileName:=sAttachPath & "\" & EMAttachment, fieldinfo:=sFieldInfo ... where sFieldInfo is set to "Array(Array(0, 1), Array(13, 1), Array(23, 1), Array(39, 1), Array(70, 1), Array(75, 1), Array(83, 1), Array(94, 1))", I get the error that I put in the Subject of this post. Anyone got any ideas?? Seems kinda' strange. TIA!! Bryan -- Dave Peterson -- Dave Peterson |
All times are GMT +1. The time now is 01:58 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com