Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Can I start the text import wizard automatically?

Hi everybody!
I have a file format which is actually CSV but has my own extension. I`ve
manually registered it in the windows registry to be opened by MS Excel. If I
open these files from Windows Explorer (not from Excel "Open file" dialog) I
need to start Text import wizard manually to properly format data from them.
Is there a way to launch Text import wizard automatically and with desired
settings in it? If yes, I`d like to have a solution for all versions of MS
Excel.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Can I start the text import wizard automatically?

Only way I can think of it so turn on the macro recorder and open it
manually. When done, turn off the macro recorder and look at the recorded
code. It should be the OpenText method.

Now you can generalize the code to allow a variable file name.

If you want to be able to double click on your file and this macro kick in,
I doubt you can do that.

--
Regards,
Tom Ogilvy


"pahan" wrote:

Hi everybody!
I have a file format which is actually CSV but has my own extension. I`ve
manually registered it in the windows registry to be opened by MS Excel. If I
open these files from Windows Explorer (not from Excel "Open file" dialog) I
need to start Text import wizard manually to properly format data from them.
Is there a way to launch Text import wizard automatically and with desired
settings in it? If yes, I`d like to have a solution for all versions of MS
Excel.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Can I start the text import wizard automatically?

" I`d like to have a solution for all versions of MS Excel."
I can't thing of a response to this that would be appropriate.

However, I just pieced this together; see if gets you started...
'--
Sub DoItMyWay()
Dim vResult As Variant
On Error Resume Next
vResult = Application.Dialogs(xlDialogImportTextFile).Show
On Error GoTo 0
If vResult = False Then
Exit Sub
Else
'do it
End If
End Sub
'--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"pahan"
wrote in message
Hi everybody!
I have a file format which is actually CSV but has my own extension. I`ve
manually registered it in the windows registry to be opened by MS Excel. If I
open these files from Windows Explorer (not from Excel "Open file" dialog) I
need to start Text import wizard manually to properly format data from them.
Is there a way to launch Text import wizard automatically and with desired
settings in it? If yes, I`d like to have a solution for all versions of MS
Excel.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Can I start the text import wizard automatically?



Well, and what if putting such a macro in the AutoOpen macro and requiring
my customers to enable macroses in Excel? Can I alter the Excel AutoOpen
macro from my application setup program?

"Tom Ogilvy" wrote:
Only way I can think of it so turn on the macro recorder and open it
manually. When done, turn off the macro recorder and look at the recorded
code. It should be the OpenText method.
If you want to be able to double click on your file and this macro kick in,
I doubt you can do that.

--
Regards,
Tom Ogilvy


"pahan" wrote:

Hi everybody!
I have a file format which is actually CSV but has my own extension. I`ve
manually registered it in the windows registry to be opened by MS Excel. If I
open these files from Windows Explorer (not from Excel "Open file" dialog) I
need to start Text import wizard manually to properly format data from them.
Is there a way to launch Text import wizard automatically and with desired
settings in it? If yes, I`d like to have a solution for all versions of MS
Excel.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Can I start the text import wizard automatically?

An autoopen macro is specific and is contained in the workbook being opened.
Since your files are not xls files, then there is no way to have a macro in
them.

You would need to modify each users personal.xls file (or put in an
additional equivalentfile) to instantiate application level events and
install code that would kick off the text to columns code when it recognized
that one of your text files had been opened. However, I am not sure
personal.xls is loaded when you double click on a file - you would have to
test it an see.

It seems like what you really want is to modify Excel to recognize your file
extension and process it as .CSV, but I don't believe there is a way to do
that. .

--
Regards,
Tom Ogilvy
"pahan" wrote in message
...


Well, and what if putting such a macro in the AutoOpen macro and requiring
my customers to enable macroses in Excel? Can I alter the Excel AutoOpen
macro from my application setup program?

"Tom Ogilvy" wrote:
Only way I can think of it so turn on the macro recorder and open it
manually. When done, turn off the macro recorder and look at the
recorded
code. It should be the OpenText method.
If you want to be able to double click on your file and this macro kick
in,
I doubt you can do that.

--
Regards,
Tom Ogilvy


"pahan" wrote:

Hi everybody!
I have a file format which is actually CSV but has my own extension.
I`ve
manually registered it in the windows registry to be opened by MS
Excel. If I
open these files from Windows Explorer (not from Excel "Open file"
dialog) I
need to start Text import wizard manually to properly format data from
them.
Is there a way to launch Text import wizard automatically and with
desired
settings in it? If yes, I`d like to have a solution for all versions of
MS
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
Text Import Wizard perplexIN Excel Discussion (Misc queries) 2 March 4th 09 11:45 AM
How to Start Excel in Text Import Wizard for data import rlelvis Setting up and Configuration of Excel 0 July 10th 08 08:40 PM
Text Import Wizard GARY Excel Discussion (Misc queries) 1 December 24th 06 08:40 PM
Text Import Wizard vclemmons Setting up and Configuration of Excel 0 May 10th 06 10:22 PM
Text Import Wizard Prema Excel Discussion (Misc queries) 3 April 5th 06 03:11 PM


All times are GMT +1. The time now is 12:45 PM.

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"