View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
GS GS is offline
external usenet poster
 
Posts: 364
Default How to open the //Text Import Wizard// from within a macro?

Hi Erland,

<<If all your textfiles have fixed width columns you could try
the bottomlast -else- part of my macro
'** I usually import the textfiles with the default settings in the Import
Wizard. For example, when the wizard opens I just click Finish. I did add a
line to both procedures to autofit the columns though.


<<just discovered the second flaw in my code: -the first and obvious is the
blank workbook with one sheet left behind if choosing cancel in the open file
dialog
'** With my multi-select code, if the user cancels, nothing happens.
'** With the single-select code, if the user cancels, the active sheet gets
moved to the end. I will add the same check to see if the user cancelled.
-Thanks for pointing this out.


<<if the is macro run first thing after excel startup, the first textfile
replaces the default empty book1 at startup, and is not collected together
with the rest of the files
'** With both procedures, it is assumed the active workbook is a saved file.
If you're putting these into a new file then save the default Book1
beforehand. -Sorry I did not mention this, but my understanding was you are
periodically inserting textfiles into an existing workbook.

Regards,
Garry