You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

How to save excel file in unique format

1 reply [Last post]
Guest's picture
Guest

Hi! is it possible to make a macro in excel which saves the excel spreadsheet as a unique extension like .TS2 so that the file cannot be opened by excel directly, there would be another macro through which it can only be retreived.

thanks!

Lepa's picture
User offline. Last seen 1 year 49 weeks ago. Offline
Joined: 06/23/2008
Posts: 591
Re: How to save excel file in unique format

Check out this post - it forces the file to be saved as a .txt file - you can easily change that to .TS2

http://www.compshack.com/visual-basic/save-file-using-visual-basic-excel-macro

You code will look something like this instead:
InitialFileName:="C:\temp\filename_" + VBA.Strings.Format(Now, "mmddyyyy") + ".TS2", _
fileFilter:="Text Files (*.TS2), *.TS2")

Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog