View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_5_] Dave Peterson[_5_] is offline
external usenet poster
 
Posts: 1,758
Default 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