ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adding a new excel file type (https://www.excelbanter.com/excel-programming/272519-adding-new-excel-file-type.html)

Wim Glassee

Adding a new excel file type
 
Hi all,

I have a certain type of tab seperated file that I would like to load
in Excel.

I have a macro that will do the trick for me, but I'd like to make
things a bit easier on my users, by allowing them to open these files
transparently.

Ideally, I would like to have:

myfile.myextension

registered to be opened by microsoft excel on double click

And, here it comes, add the .myextension file type to the list of
default file types in excel, and hook up my macro when it wants to
open a file of this type.

Can this be done?

Thanks in advance,

Wim

AA[_2_]

Adding a new excel file type
 
Windows Explorer + Tools + Folder Options...

Then

File Types + New, type extension in the box, Click
Advanced, Select Microsoft Excel Application.

-----Original Message-----
Hi all,

I have a certain type of tab seperated file that I would

like to load
in Excel.

I have a macro that will do the trick for me, but I'd

like to make
things a bit easier on my users, by allowing them to open

these files
transparently.

Ideally, I would like to have:

myfile.myextension

registered to be opened by microsoft excel on double click

And, here it comes, add the .myextension file type to the

list of
default file types in excel, and hook up my macro when it

wants to
open a file of this type.

Can this be done?

Thanks in advance,

Wim
.


Wim Glassee

Adding a new excel file type
 
Hi Mike,

thanks for your speedy answer, but it didn't seem to work
unfortunately.

I added the piece of code to the a hidden worbook I keep in XLStart
that also holds the parse macro, but it doesn't seem to jump in when
it should.

I've been reading some more on the groups and it seems it might be
possible to create a fileconverter, but there is hardly any
information available on the fileconverter API. This solution would be
the cleanest of course, this way no matter how you open a file, it
will be parsed correctly.

Another solution for me would be to 'override' text import wizard. The
default for each cell is 'general', and I would like it to be text.
Does anybody have any idea how this can be accomplished? Is it in the
registry somewhere?

Thanks,

Wim

"Mike" wrote in message ...
Creating the file association is simple. Open Windows
Explorer, right-click the file, select Open With, check
the "Always Open with..." check box, then choose Excel
from the list.

Having your macro parse this file after it opens is a bit
more tricky. It would be far easier to have people open
the file from within Excel, but it can be done. When you
double-click the file in Win Explorer, Excel loads, then
anything in your XLSTART folder (ie personal.xls file) is
loaded, then anything in the alternate startup folder is
loaded, then finally the file you clicked is loaded. In
order to get your macro to run, you may be able to make
use of the WindowDeactivate event of a book stored in the
alternate startup folder. Try this out for size, and
hopefully it will provide enough of a jumping point for
you.

Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)

For w = 1 To Application.Workbooks.Count
If Right(Application.Workbooks(w).Name, 3) = "tab" Then
MsgBox ("Run Parse Macro")
End If
Next

End Sub




-----Original Message-----
Hi all,

I have a certain type of tab seperated file that I would

like to load
in Excel.

I have a macro that will do the trick for me, but I'd

like to make
things a bit easier on my users, by allowing them to open

these files
transparently.

Ideally, I would like to have:

myfile.myextension

registered to be opened by microsoft excel on double click

And, here it comes, add the .myextension file type to the

list of
default file types in excel, and hook up my macro when it

wants to
open a file of this type.

Can this be done?

Thanks in advance,

Wim
.



All times are GMT +1. The time now is 04:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com