Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to Find Incompatible Cell Formatting XL 2003 / 2007 ?? | Excel Discussion (Misc queries) | |||
Table References Incompatible with Trace | Excel Discussion (Misc queries) | |||
Is vista beta RC1 incompatible with Excel? | Excel Discussion (Misc queries) | |||
.csv incompatible message after saving | Excel Worksheet Functions | |||
Excel 2003 versus 2002 seem incompatible related to the EDATE fun. | Excel Worksheet Functions |