Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default 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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default 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






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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










  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default 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



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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





  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default 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







  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default 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








  #10   Report Post  
Posted to microsoft.public.excel.programming
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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenText Method of Workbook Object Question John Excel Programming 2 October 20th 04 07:39 PM
Runtime error 1004 with method OpenText - but only on one computer Kew[_2_] Excel Programming 0 August 30th 04 11:52 PM
How to use Opentext method with xlFixedWidth? Together[_8_] Excel Programming 2 March 3rd 04 03:27 PM
Pass string as Parameter in OpenText method No Name Excel Programming 0 January 8th 04 06:22 AM
Can we Pass String to FieldInfo Array to OpenText Method. Niraj Kumar Singh Excel Programming 0 January 8th 04 05:35 AM


All times are GMT +1. The time now is 11:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"