+ Reply to Thread
Results 1 to 5 of 5

Opening a text file in excel

  1. #1
    Opyuse
    Guest

    Opening a text file in excel

    Using a visual basic 6.0 I have created a tab delimiated text file, which is
    an export of a Query.

    I what to then open this file automaticly after it is created in Excel.

    I've looked about and can't find anyone with a simple answer. Most questions
    involve macros but I'm working from a vb application to excel.

    How do I open Excel?



  2. #2
    Opyuse
    Guest

    RE: Opening a text file in excel

    Dim xlTmp As Excel.Application

    Set xlTmp = New Excel.Application
    xlTmp.Workbooks.Open Fname$

    I have tried the following but I get the error message:
    "User-defined type not defined"

    Fname$ Contains the path of the text file.

  3. #3
    Opyuse
    Guest

    RE: Opening a text file in excel

    I've add the excel libary to the project but it still won't open.

    This time however there is no error message.

  4. #4
    Opyuse
    Guest

    RE: Opening a text file in excel

    For some reason when I us this method the file is uneditable.

    When I try to open it manually I'm told that another user has set it this way.

    I've added to the code with

    test = xlTmp.Workbooks.Open(Fname$, , 0, 1, , , , , , True)

    which if I read the help right should have set it to editable.

    What is going on?
    And can someone please answer me!

    "Opyuse" wrote:

    > Using a visual basic 6.0 I have created a tab delimiated text file, which is
    > an export of a Query.
    >
    > I what to then open this file automaticly after it is created in Excel.
    >
    > I've looked about and can't find anyone with a simple answer. Most questions
    > involve macros but I'm working from a vb application to excel.
    >
    > How do I open Excel?
    >
    >


  5. #5
    bj
    Guest

    RE: Opening a text file in excel

    try <data>< import external data> and follow the wizard.

    "Opyuse" wrote:

    > For some reason when I us this method the file is uneditable.
    >
    > When I try to open it manually I'm told that another user has set it this way.
    >
    > I've added to the code with
    >
    > test = xlTmp.Workbooks.Open(Fname$, , 0, 1, , , , , , True)
    >
    > which if I read the help right should have set it to editable.
    >
    > What is going on?
    > And can someone please answer me!
    >
    > "Opyuse" wrote:
    >
    > > Using a visual basic 6.0 I have created a tab delimiated text file, which is
    > > an export of a Query.
    > >
    > > I what to then open this file automaticly after it is created in Excel.
    > >
    > > I've looked about and can't find anyone with a simple answer. Most questions
    > > involve macros but I'm working from a vb application to excel.
    > >
    > > How do I open Excel?
    > >
    > >


+ 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