+ Reply to Thread
Results 1 to 5 of 5

Workbooks.OpenText problem in XL2000

Hybrid View

  1. #1
    Mike Iacovou
    Guest

    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. #2
    Ron de Bruin
    Guest

    Re: 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" <MikeIacovou@discussions.microsoft.com> wrote in message news:62A02098-BFF6-423B-86D9-805BF87A756B@microsoft.com...
    > 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. #3
    Mike Iacovou
    Guest

    Re: 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. #4
    Mike Iacovou
    Guest

    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. #5
    Ron de Bruin
    Guest

    Re: NOT a problem with OpenText... (!)

    Hi Mike

    Working for me in Excel 2000

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


    "Mike Iacovou" <MikeIacovou@discussions.microsoft.com> wrote in message news:DFA60DB3-FD8D-453D-8048-2B38B19570D9@microsoft.com...
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1