I have a workbook that is used in a mixed Excel 2002, 2003, 2007 and probably 2010 environment. About a month ago, all the VBA code 'disappeared' from the workbook. I presume that one of the users with 2007 did a 'save as' and accepted the default .xlsx format and then later on a 2003 user saved it back to .xls format since that was the extension when I was called about the problem.
I need a way to force the workbook to be saved only as .xls (format 56). I have some questions about this:
I would like to allow all users to be able to save, not 'save as' the file as they work on it in case some disaster happens. If a 2007 or 2010 user opens an .xls file (format 56), and saves it, is the file saved with it's original file format (.xls), or as a file of the default file format of 2007/2010 ? I think that the answer is .xls.
I would like to allow certain users password protected access to 'save as' across all platforms. What is the best way to accomplish this ? I was thinking that I could put password prompting/checking code in Workbook.BeforeSave and check that SaveAsUI is true and be done but I am not sure that this would be sufficient. Any ideas about this ?
Lastly, I am not sure about how to use Application.DefaultSaveFormat. I have played around with this by putting this in the beginning of my code, but when I go to 'save as' the suggested default format is not the one that I specified with Application.DefaultSaveFormat. Does Application.DefaultSaveFormat only apply to 'save' and not 'save as' since the user can always override the suggested format in 'save as' ?
I am not proud. If anyone knows of code that will accomplish what I want, i.e force the saving of a workbook with a certain format, please point me in that direction.
Thanks
I need a way to force the workbook to be saved only as .xls (format 56). I have some questions about this:
I would like to allow all users to be able to save, not 'save as' the file as they work on it in case some disaster happens. If a 2007 or 2010 user opens an .xls file (format 56), and saves it, is the file saved with it's original file format (.xls), or as a file of the default file format of 2007/2010 ? I think that the answer is .xls.
I would like to allow certain users password protected access to 'save as' across all platforms. What is the best way to accomplish this ? I was thinking that I could put password prompting/checking code in Workbook.BeforeSave and check that SaveAsUI is true and be done but I am not sure that this would be sufficient. Any ideas about this ?
Lastly, I am not sure about how to use Application.DefaultSaveFormat. I have played around with this by putting this in the beginning of my code, but when I go to 'save as' the suggested default format is not the one that I specified with Application.DefaultSaveFormat. Does Application.DefaultSaveFormat only apply to 'save' and not 'save as' since the user can always override the suggested format in 'save as' ?
I am not proud. If anyone knows of code that will accomplish what I want, i.e force the saving of a workbook with a certain format, please point me in that direction.
Thanks