Opening a text file in excel

O

Opyuse

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?
 
O

Opyuse

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.
 
O

Opyuse

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

This time however there is no error message.
 
O

Opyuse

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!
 
Top