PC Review


Reply
Thread Tools Rate Thread

Can I start the text import wizard automatically?

 
 
=?Utf-8?B?cGFoYW4=?=
Guest
Posts: n/a
 
      20th Feb 2007
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 With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      20th Feb 2007
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.

 
Reply With Quote
 
Jim Cone
Guest
Posts: n/a
 
      20th Feb 2007
Re: " 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" <(E-Mail Removed)>
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.
 
Reply With Quote
 
=?Utf-8?B?cGFoYW4=?=
Guest
Posts: n/a
 
      24th Feb 2007


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 With Quote
 
Tom Ogilvy
Guest
Posts: n/a
 
      25th Feb 2007
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" <(E-Mail Removed)> wrote in message
news:45CE7E63-273E-44C5-B9FD-(E-Mail Removed)...
>
>
> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Start Excel in Text Import Wizard for data import rlelvis Microsoft Excel Setup 0 10th Jul 2008 08:40 PM
Text import wizard does import properly beyond text file line 1048 Bas V Microsoft Excel Discussion 5 22nd May 2008 12:19 AM
Import Text Wizard Specification template, import/copy from one mdb to another? Kevin Microsoft Access Getting Started 3 9th Sep 2004 11:46 PM
file import defaults for text import wizard stefan Microsoft Excel Setup 0 17th Aug 2004 03:08 PM
Import text wizard -- won't import Joe Microsoft Access External Data 0 7th Jul 2003 05:37 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:11 AM.