app events and drag-drop

  • Thread starter Thread starter ac
  • Start date Start date
A

ac

Greetings,

I have been diving through Google for several hours trying to find a
solution and have come here for help...

Please keep in mind that I'm pretty new to programming VB in Excel...

I would like to trap the user's drag-n-drop (and File Open) so that
when they drop a CSV file on Excel, I can override the default
behavior to use the equivalent of the Text Wizard. Renaming the CSV to
txt is not really an option.

I have tried looking at WithEvents, but I get notified too late. The
worksheet is up by the time I get a SheetActivate and a WorkbookOpen.

Does anyone know how I can trap this?

Many Thanks,

Allan
 
I don't think you can do it via application events. (I got notified too late,
too.)

Maybe you could provide another workbook that would open the .csv files.
Retrieve the name from the user (getopenfilename??) and then do what you
want--renaming and processing as a .txt file or even opening the file and
parsing it the way you want.)

MS has an article that you may want to read:

File Access with Visual Basic® for Applications
http://support.microsoft.com/support/excel/content/fileio/fileio.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top