Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Workbooks.OpenText problem in XL2000

Hi there. the following code (to import CSV data into worksheet) seems to
work ok in XL2002+, but results in an error on XL2000 regarding the opentext
command (this error was reported to me, and sadly i dont have the error code
etc). I suspect that either one of the operands is invalid in XL2000, or
XL2000 is a little more strict and i have left something out... please
advise. TIA

Workbooks.OpenText Filename:=sPath, Origin:=437, StartRow:=1,
DataType:=xlDelimited, TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Semicolon:=False, Comma:=True
With ActiveWorkbook
.Worksheets(1).UsedRange.Copy copyTo.Range("A1")
.Close False
End With
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Workbooks.OpenText problem in XL2000

Hi Mike

This is your problem

Origin:=437

? xlWindows
2
? xlMacintosh
1
? xlMSDOS
3

If this argument is omitted, the method uses the current setting of the File Origin option in the Text Import Wizard


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Mike Iacovou" wrote in message ...
Hi there. the following code (to import CSV data into worksheet) seems to
work ok in XL2002+, but results in an error on XL2000 regarding the opentext
command (this error was reported to me, and sadly i dont have the error code
etc). I suspect that either one of the operands is invalid in XL2000, or
XL2000 is a little more strict and i have left something out... please
advise. TIA

Workbooks.OpenText Filename:=sPath, Origin:=437, StartRow:=1,
DataType:=xlDelimited, TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Semicolon:=False, Comma:=True
With ActiveWorkbook
.Worksheets(1).UsedRange.Copy copyTo.Range("A1")
.Close False
End With



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Workbooks.OpenText problem in XL2000

many thanks Ron
sadly, it still doesn't appear to work.
the exact error code is: 438 'object doesn't support this property/method'
i'll investigate further, but any further ideas greatly appreciated. Code
now stands at:

['WorkPath' / 'fname' are global variables]

Dim wb As Workbook, sPath As String
sPath = WorkPath & fname
Workbooks.OpenText Filename:=sPath, StartRow:=1, DataType:=xlDelimited,
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Semicolon:=False,
Comma:=True
With ActiveWorkbook
.Worksheets(1).UsedRange.Copy copyTo.Range("A1")
.Close False
End With

Cheers
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default NOT a problem with OpenText... (!)

Hi Ron.
I have managed to actually find the routine inquestion - it is NOT the
workbooks.opentext code (although i am sure that the tag i have removed would
cause problems if the system actually got as far as that). The problem is
actually with BrowseForFolder - or more accurates with obj.SELF.path - i will
start a new thread as any responses will be under the wrong problem subject
(if omitting the tag fails to correct the problem). I suspect the 'SELF' tag
is not supported in XL2000... i'll try without.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default NOT a problem with OpenText... (!)

Hi Mike

Working for me in Excel 2000

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Mike Iacovou" wrote in message ...
Hi Ron.
I have managed to actually find the routine inquestion - it is NOT the
workbooks.opentext code (although i am sure that the tag i have removed would
cause problems if the system actually got as far as that). The problem is
actually with BrowseForFolder - or more accurates with obj.SELF.path - i will
start a new thread as any responses will be under the wrong problem subject
(if omitting the tag fails to correct the problem). I suspect the 'SELF' tag
is not supported in XL2000... i'll try without.



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
XL2000 Links Between Workbooks LPS Excel Worksheet Functions 2 November 3rd 09 02:37 AM
Workbooks.OpenText StartRow:=2 Not Skipping Row 1 John Saunders Excel Programming 2 August 26th 05 11:51 AM
Workbooks.OpenText does not work on XP. HELP !!! [email protected] Excel Programming 6 May 31st 05 03:18 PM
How to open UTF-8 files with Workbooks.OpenText Mete Kural Excel Programming 0 May 7th 05 01:25 AM
Workbooks.OpenText Alistair Eberst Excel Programming 2 October 21st 03 12:50 PM


All times are GMT +1. The time now is 04:27 AM.

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"