Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Macro crashing on different computer

I am virtually certain, before I left home, this macro
worked fine on my home computer. I am trying it on a
visited computer, as a test for doing it before a client
soon on their computer, and it is crashing:

Workbooks.OpenText Filename:=myFilename, Origin:=437,
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array( _
Array(0, 1), Array(7, 3), Array(17, 1), Array(32,
1), Array(40, 1), Array(48, 1)), _
TrailingMinusNumbers:=True

It is giving me a comile error: Named argument not found
and when i hit debug, it highlights the part that says
TrailingMinusNumbers:=True, as if that is the offending
part.

I note that, it I record that part of the macxro on this
visiting computer, it does not record that seemingly
offensive ending. Also, instead of Origin = 437, it says
origin:=x1Windows, though when I try editing my macro
with either of those, it crashes on those. I also note
that this computer has EXCEL 2000, not 2002. Can someone
help, please?

Thanks
G
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Macro crashing on different computer

yep... version incompatibility.. :)

next time just check MSDN:


excel 2000
http://msdn.microsoft.com/library/de...l=/library/en-
us/off2000/html/xlmthOpenText.asp

OpenText Method

Loads and parses a text file as a new workbook with a single sheet that
contains the parsed text-file data.

Syntax

expression.OpenText(Filename, Origin, StartRow, DataType, TextQualifier,
ConsecutiveDelimiter, Tab, Semicolon, Comma, Space, Other, OtherChar,
FieldInfo, DecimalSeparator, ThousandsSeparator)



excel 2002

http://msdn.microsoft.com/library/de...l=/library/en-
us/vbaxl10/html/xlmthOpenText.asp?frame=true

OpenText Method

Loads and parses a text file as a new workbook with a single sheet that
contains the parsed text-file data.

expression.OpenText(FileName, Origin, StartRow, DataType, TextQualifier,
ConsecutiveDelimiter, Tab, Semicolon, Comma, Space, Other, OtherChar,
FieldInfo, TextVisualLayout, DecimalSeparator, ThousandsSeparator,
TrailingMinusNumbers, Local)





keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Grace" wrote:

I am virtually certain, before I left home, this macro
worked fine on my home computer. I am trying it on a
visited computer, as a test for doing it before a client
soon on their computer, and it is crashing:

Workbooks.OpenText Filename:=myFilename, Origin:=437,
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array( _
Array(0, 1), Array(7, 3), Array(17, 1), Array(32,
1), Array(40, 1), Array(48, 1)), _
TrailingMinusNumbers:=True

It is giving me a comile error: Named argument not found
and when i hit debug, it highlights the part that says
TrailingMinusNumbers:=True, as if that is the offending
part.

I note that, it I record that part of the macxro on this
visiting computer, it does not record that seemingly
offensive ending. Also, instead of Origin = 437, it says
origin:=x1Windows, though when I try editing my macro
with either of those, it crashes on those. I also note
that this computer has EXCEL 2000, not 2002. Can someone
help, please?

Thanks
G


  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Macro crashing on different computer

So, it looks identical up through field info. But I seem
to be having a problem, even if I end it right at

Array(48, 1))

Shouldn't it work that way with EXCEL 2000?

Thx,
G

-----Original Message-----
yep... version incompatibility.. :)

next time just check MSDN:


excel 2000
http://msdn.microsoft.com/library/default.asp?

url=/library/en-
us/off2000/html/xlmthOpenText.asp

OpenText Method

Loads and parses a text file as a new workbook with a

single sheet that
contains the parsed text-file data.

Syntax

expression.OpenText(Filename, Origin, StartRow,

DataType, TextQualifier,
ConsecutiveDelimiter, Tab, Semicolon, Comma, Space,

Other, OtherChar,
FieldInfo, DecimalSeparator, ThousandsSeparator)



excel 2002

http://msdn.microsoft.com/library/default.asp?

url=/library/en-
us/vbaxl10/html/xlmthOpenText.asp?frame=true

OpenText Method

Loads and parses a text file as a new workbook with a

single sheet that
contains the parsed text-file data.

expression.OpenText(FileName, Origin, StartRow,

DataType, TextQualifier,
ConsecutiveDelimiter, Tab, Semicolon, Comma, Space,

Other, OtherChar,
FieldInfo, TextVisualLayout, DecimalSeparator,

ThousandsSeparator,
TrailingMinusNumbers, Local)





keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Grace" wrote:

I am virtually certain, before I left home, this macro
worked fine on my home computer. I am trying it on a
visited computer, as a test for doing it before a

client
soon on their computer, and it is crashing:

Workbooks.OpenText Filename:=myFilename, Origin:=437,
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(

_
Array(0, 1), Array(7, 3), Array(17, 1), Array

(32,
1), Array(40, 1), Array(48, 1)), _
TrailingMinusNumbers:=True

It is giving me a comile error: Named argument not

found
and when i hit debug, it highlights the part that says
TrailingMinusNumbers:=True, as if that is the

offending
part.

I note that, it I record that part of the macxro on

this
visiting computer, it does not record that seemingly
offensive ending. Also, instead of Origin = 437, it

says
origin:=x1Windows, though when I try editing my macro
with either of those, it crashes on those. I also

note
that this computer has EXCEL 2000, not 2002. Can

someone
help, please?

Thanks
G


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro crashing on different computer

Also, why did it record something very different for
origin (see original post below)?

G

-----Original Message-----
So, it looks identical up through field info. But I

seem
to be having a problem, even if I end it right at

Array(48, 1))

Shouldn't it work that way with EXCEL 2000?

Thx,
G

-----Original Message-----
yep... version incompatibility.. :)

next time just check MSDN:


excel 2000
http://msdn.microsoft.com/library/default.asp?

url=/library/en-
us/off2000/html/xlmthOpenText.asp

OpenText Method

Loads and parses a text file as a new workbook with a

single sheet that
contains the parsed text-file data.

Syntax

expression.OpenText(Filename, Origin, StartRow,

DataType, TextQualifier,
ConsecutiveDelimiter, Tab, Semicolon, Comma, Space,

Other, OtherChar,
FieldInfo, DecimalSeparator, ThousandsSeparator)



excel 2002

http://msdn.microsoft.com/library/default.asp?

url=/library/en-
us/vbaxl10/html/xlmthOpenText.asp?frame=true

OpenText Method

Loads and parses a text file as a new workbook with a

single sheet that
contains the parsed text-file data.

expression.OpenText(FileName, Origin, StartRow,

DataType, TextQualifier,
ConsecutiveDelimiter, Tab, Semicolon, Comma, Space,

Other, OtherChar,
FieldInfo, TextVisualLayout, DecimalSeparator,

ThousandsSeparator,
TrailingMinusNumbers, Local)





keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Grace" wrote:

I am virtually certain, before I left home, this

macro
worked fine on my home computer. I am trying it on a
visited computer, as a test for doing it before a

client
soon on their computer, and it is crashing:

Workbooks.OpenText Filename:=myFilename, Origin:=437,
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array

(
_
Array(0, 1), Array(7, 3), Array(17, 1), Array

(32,
1), Array(40, 1), Array(48, 1)), _
TrailingMinusNumbers:=True

It is giving me a comile error: Named argument not

found
and when i hit debug, it highlights the part that

says
TrailingMinusNumbers:=True, as if that is the

offending
part.

I note that, it I record that part of the macxro on

this
visiting computer, it does not record that seemingly
offensive ending. Also, instead of Origin = 437, it

says
origin:=x1Windows, though when I try editing my macro
with either of those, it crashes on those. I also

note
that this computer has EXCEL 2000, not 2002. Can

someone
help, please?

Thanks
G


.

.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Macro crashing on different computer


the ARRAY is part of the fieldinfo argument,that has nothing todo with
your problem..


you recorded it in xl2002..

it then records/uses some arguments which may OR MAY NOT be available in
prior versions.

Would you be trying it in xl97 your whole routine would fail,
as xl97 doesn't have the importtext method...

You're trying it in xl2000 which doesn't have the arguments for trailing
minus and locale settings...


the problem is the use of TrailingMinusNumbers or Local argument, which
excel 2000 cannot compile...

just remove the trailing minus argument and you should be fine..

EXCEPT you're not fine ...
as your data apparently DOES include trailing minuses..


excel2000 cannot handle those INSIDE the textimport function,
so to make a compatible routine you have to do some post processing..

remove the trailing minus argument..
the AFTER you import the data you need to sweep the range..

dim rng as range
For each rng in [a1].currentregion.cells
if rng.value like "*-" then
rng.value = Left(rng.value,len(rng.value)-1) *-1
endif
next


Hth :)



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"add to prior question" wrote:

Also, why did it record something very different for
origin (see original post below)?

G

-----Original Message-----
So, it looks identical up through field info. But I seem
to be having a problem, even if I end it right at

Array(48, 1))

Shouldn't it work that way with EXCEL 2000?

Thx,
G



  #6   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Macro crashing on different computer

I don't think I was clear enough or was hoping you'd read
my first post carefully. Your first response seemed to
idnicate that, as long as I shortened my x12002 command
to end after the "field info" data, it should work.

Here is what I have:

Workbooks.OpenText Filename:="fllcgsumprf.*",
Origin:=437, StartRow:=1, DataType:=xlFixedWidth,
FieldInfo:=Array( _
Array(0, 1), Array(7, 3), Array(17, 1), Array(32,
1), Array(40, 1), Array(48, 1))

The error messgae is that Method 'OpenText' of object
workbooks failed. Actually, the filename really should
be a variable but to eliminate sources of problems, I
have temporarily hardcoded the filename. It is a text
type CSV file. Perhaps, X12000 doesn't recognize the
command? What do you think?

Also, I'm not sure what the post processing is supposed
to do. Can soemone tell me?

Thx
-----Original Message-----

the ARRAY is part of the fieldinfo argument,that has

nothing todo with
your problem..


you recorded it in xl2002..

it then records/uses some arguments which may OR MAY NOT

be available in
prior versions.

Would you be trying it in xl97 your whole routine would

fail,
as xl97 doesn't have the importtext method...

You're trying it in xl2000 which doesn't have the

arguments for trailing
minus and locale settings...


the problem is the use of TrailingMinusNumbers or Local

argument, which
excel 2000 cannot compile...

just remove the trailing minus argument and you should

be fine..

EXCEPT you're not fine ...
as your data apparently DOES include trailing minuses..


excel2000 cannot handle those INSIDE the textimport

function,
so to make a compatible routine you have to do some post

processing..

remove the trailing minus argument..
the AFTER you import the data you need to sweep the

range..

dim rng as range
For each rng in [a1].currentregion.cells
if rng.value like "*-" then
rng.value = Left(rng.value,len(rng.value)-1) *-1
endif
next


Hth :)



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"add to prior question"

wrote:

Also, why did it record something very different for
origin (see original post below)?

G

-----Original Message-----
So, it looks identical up through field info. But I

seem
to be having a problem, even if I end it right at

Array(48, 1))

Shouldn't it work that way with EXCEL 2000?

Thx,
G

.

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
Can you run a macro while your computer is locked? dorn Excel Discussion (Misc queries) 1 November 8th 08 02:20 AM
Moving a macro to another computer saidanddone Excel Discussion (Misc queries) 2 May 14th 08 06:28 PM
Macro will work on one computer but not on another Gillian Excel Worksheet Functions 11 June 15th 07 08:57 PM
Macro Crashing Excel ultra_xcyter[_3_] Excel Programming 0 June 28th 04 02:56 PM
Macro doesn't run on another computer Terence Excel Programming 1 February 23rd 04 03:06 AM


All times are GMT +1. The time now is 12:27 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"