+ Reply to Thread
Results 1 to 3 of 3

syntax opentext

  1. #1
    Registered User
    Join Date
    03-29-2011
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    4

    syntax opentext

    hi guys.

    I know this is probably super-basic, but could i get some help with this syntax?

    Sub opentxt()

    Dim filepath As String

    filepath = "C:\Users\admin\Desktop"

    workbooks.opentext (Sample,filepath, , xldelimited, ,,,,,true)


    End Sub


    I'm just trying to open a text file. Fields are separated by spaces.

    I'm getting "compile error, expected ="

    Cheers,
    -dk

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: syntax opentext

    What is "sample"? I thought you start with filepath

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: syntax opentext

    This is the general syntax for OpenText:

    Workbooks.OpenText(Filename, Origin, StartRow, DataType, TextQualifier, ConsecutiveDelimiter, Tab, Semicolon, Comma, Space, Other, OtherChar, FieldInfo, TextVisualLayout, DecimalSeparator, ThousandsSeparator, TrailingMinusNumbers, Local)
    If posting code please use code tags, see here.

+ 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