Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
bw bw is offline
external usenet poster
 
Posts: 74
Default Incompatible Code

The following code works with Windows 2000, but not with Windows XP. Can someone
explain why, and provide a workaround?

Also, what does "TrailingMinusNumbers" do?

Workbooks.OpenText Filename:=my2ndFileName, Origin:=437, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=myArray, _
TrailingMinusNumbers:=True

Thanks,
Bernie


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 280
Default Incompatible Code

Code works for me in XP. If I substitute local values for the variables.
What error message are you getting?

The best I can find about TrailingMinusNumbers at MSDN is this description:

TrailingMinusNumbers Optional Variant. Numbers that begin with a minus
character.
Bob Kilmer

"bw" wrote in message
...

The following code works with Windows 2000, but not with Windows XP. Can

someone
explain why, and provide a workaround?

Also, what does "TrailingMinusNumbers" do?

Workbooks.OpenText Filename:=my2ndFileName, Origin:=437, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=myArray, _
TrailingMinusNumbers:=True

Thanks,
Bernie




  #3   Report Post  
Posted to microsoft.public.excel.programming
bw bw is offline
external usenet poster
 
Posts: 74
Default Incompatible Code

Sorry about that...I should have included the error with my first message.

I should let you know that the Excel versions on the two computers are as follows:
The Windows 2000 computer is Excel 2002 (10.2614.3311)
The Windws XP computer is Excel 2000 (9.0.3821 SR1)

And from this, I see there "may" be a backward compatiblity issue. If so, what code do I
use in Excel 2000 to make it "upward" compatible with Excel 2002?

The error message I'm getting is:
Run-time error '1004':
Method 'OpenText' of object "workbooks' Failed

Thats it. I hope someone can help make this run...

Bernie



On Fri, 25 Jul 2003 20:14:48 -0400, "Bob Kilmer" wrote:
Code works for me in XP. If I substitute local values for the variables.
What error message are you getting?

The best I can find about TrailingMinusNumbers at MSDN is this description:

TrailingMinusNumbers Optional Variant. Numbers that begin with a minus
character.
Bob Kilmer

"bw" wrote in message
...

The following code works with Windows 2000, but not with Windows XP. Can

someone
explain why, and provide a workaround?

Also, what does "TrailingMinusNumbers" do?

Workbooks.OpenText Filename:=my2ndFileName, Origin:=437, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=myArray, _
TrailingMinusNumbers:=True

Thanks,
Bernie







  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default Incompatible Code

Ah, you left out the critical information -- the Excel version numbers -- in your first post!!

TrailingMinusNumbers is the problem. That was added in Excel 2002. If you don't need it, just
remove that argument so it looks like

Workbooks.OpenText Filename:=my2ndFileName, Origin:=437, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=myArray

On Sat, 26 Jul 2003 01:59:38 GMT, bw wrote:

Sorry about that...I should have included the error with my first message.

I should let you know that the Excel versions on the two computers are as follows:
The Windows 2000 computer is Excel 2002 (10.2614.3311)
The Windws XP computer is Excel 2000 (9.0.3821 SR1)

And from this, I see there "may" be a backward compatiblity issue. If so, what code do I
use in Excel 2000 to make it "upward" compatible with Excel 2002?

The error message I'm getting is:
Run-time error '1004':
Method 'OpenText' of object "workbooks' Failed

Thats it. I hope someone can help make this run...

Bernie



On Fri, 25 Jul 2003 20:14:48 -0400, "Bob Kilmer" wrote:
Code works for me in XP. If I substitute local values for the variables.
What error message are you getting?

The best I can find about TrailingMinusNumbers at MSDN is this description:

TrailingMinusNumbers Optional Variant. Numbers that begin with a minus
character.
Bob Kilmer

"bw" wrote in message
...

The following code works with Windows 2000, but not with Windows XP. Can

someone
explain why, and provide a workaround?

Also, what does "TrailingMinusNumbers" do?

Workbooks.OpenText Filename:=my2ndFileName, Origin:=437, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=myArray, _
TrailingMinusNumbers:=True

Thanks,
Bernie







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default Incompatible Code

I don't know why it doesn't work with Windows XP (maybe it's the Origin argument??).

TrailingMinusNumbers tells Excel to treat data like 123- as a negative number rather than text.


On Fri, 25 Jul 2003 23:13:30 GMT, bw wrote:

The following code works with Windows 2000, but not with Windows XP. Can someone
explain why, and provide a workaround?

Also, what does "TrailingMinusNumbers" do?

Workbooks.OpenText Filename:=my2ndFileName, Origin:=437, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=myArray, _
TrailingMinusNumbers:=True

Thanks,
Bernie




  #6   Report Post  
Posted to microsoft.public.excel.programming
bw bw is offline
external usenet poster
 
Posts: 74
Default Incompatible Code

Well, after all the help, and getting this to work on the XP machine, I now discover that
the XP code doesn't work on the W2000 machine.

To review, this code works on Windows 2000 (Excel 2002), but not the other machine:
Workbooks.OpenText Filename:=my2ndFileName, Origin:=437, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=myArray

This code works on Windows XP (Excel 2000), but not the other machine:
Workbooks.OpenText Filename:=my2ndFileName, Origin:=x1Windows, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=myArray

So the problem code is the argument "Origin" value.

So how do I make it compatible for both versions of Excel?

Thanks,
Bernie


On Fri, 25 Jul 2003 23:13:30 GMT, bw wrote:
The following code works with Windows 2000, but not with Windows XP. Can

someone
explain why, and provide a workaround?

Also, what does "TrailingMinusNumbers" do?

Workbooks.OpenText Filename:=my2ndFileName, Origin:=437, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=myArray, _
TrailingMinusNumbers:=True

Thanks,
Bernie






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Incompatible Code

is x1windows (ex-one-windows) a typo in the message or a typo in the code?

Should be XLWindows (ex-ell-windows).




bw wrote:

Well, after all the help, and getting this to work on the XP machine, I now discover that
the XP code doesn't work on the W2000 machine.

To review, this code works on Windows 2000 (Excel 2002), but not the other machine:
Workbooks.OpenText Filename:=my2ndFileName, Origin:=437, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=myArray

This code works on Windows XP (Excel 2000), but not the other machine:
Workbooks.OpenText Filename:=my2ndFileName, Origin:=x1Windows, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=myArray

So the problem code is the argument "Origin" value.

So how do I make it compatible for both versions of Excel?

Thanks,
Bernie

On Fri, 25 Jul 2003 23:13:30 GMT, bw wrote:
The following code works with Windows 2000, but not with Windows XP. Can

someone
explain why, and provide a workaround?

Also, what does "TrailingMinusNumbers" do?

Workbooks.OpenText Filename:=my2ndFileName, Origin:=437, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=myArray, _
TrailingMinusNumbers:=True

Thanks,
Bernie



--

Dave Peterson

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Incompatible Code

You can test for the version, e.g.:

Select Case Application.Version
Case "10.0" 'Excel 2002
Workbooks.OpenText Filename:=my2ndFileName, Origin:=437, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=myArray
Case "9.0" 'Excel 2000
Workbooks.OpenText Filename:=my2ndFileName, Origin:=x1Windows, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=myArray
Case Else
MsgBox "Wrong version"
Exit Sub
End Select


bw wrote:
Well, after all the help, and getting this to work on the XP machine, I now discover that
the XP code doesn't work on the W2000 machine.

To review, this code works on Windows 2000 (Excel 2002), but not the other machine:
Workbooks.OpenText Filename:=my2ndFileName, Origin:=437, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=myArray

This code works on Windows XP (Excel 2000), but not the other machine:
Workbooks.OpenText Filename:=my2ndFileName, Origin:=x1Windows, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=myArray

So the problem code is the argument "Origin" value.

So how do I make it compatible for both versions of Excel?

Thanks,
Bernie


On Fri, 25 Jul 2003 23:13:30 GMT, bw wrote:

The following code works with Windows 2000, but not with Windows XP. Can


someone

explain why, and provide a workaround?

Also, what does "TrailingMinusNumbers" do?

Workbooks.OpenText Filename:=my2ndFileName, Origin:=437, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=myArray, _
TrailingMinusNumbers:=True

Thanks,
Bernie









--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

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
How to Find Incompatible Cell Formatting XL 2003 / 2007 ?? monir Excel Discussion (Misc queries) 3 July 9th 08 07:17 PM
Table References Incompatible with Trace TKS_Mark Excel Discussion (Misc queries) 0 November 20th 07 09:02 PM
Is vista beta RC1 incompatible with Excel? [email protected] Excel Discussion (Misc queries) 1 November 24th 06 06:02 PM
.csv incompatible message after saving smoker Excel Worksheet Functions 1 October 5th 05 04:28 PM
Excel 2003 versus 2002 seem incompatible related to the EDATE fun. MCLENO Excel Worksheet Functions 1 April 20th 05 08:34 PM


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