Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Opyuse
 
Posts: n/a
Default 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   Report Post  
Opyuse
 
Posts: n/a
Default

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   Report Post  
Opyuse
 
Posts: n/a
Default

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

This time however there is no error message.
  #4   Report Post  
Opyuse
 
Posts: n/a
Default

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   Report Post  
bj
 
Posts: n/a
Default

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
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
How can I save a file as a comma-delimited text file in Excel? LAM Excel Discussion (Misc queries) 1 May 3rd 05 10:24 PM
How do I view all file types permanantly when opening in Excel? Paula Scarborough, ME Setting up and Configuration of Excel 1 April 28th 05 05:02 AM
Weekly Transaction Processing Ralph Howarth Excel Worksheet Functions 4 January 19th 05 05:37 AM
restrict opening Excel file residing on a shared drive to one user k-ham Excel Discussion (Misc queries) 1 January 7th 05 01:57 AM
Problem opening an XML file in Excel - getting "ns1:macrosPresent" rprondeau Excel Discussion (Misc queries) 0 December 15th 04 03:39 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"