I have written some VBA in excel 2003 part of the code opens new workbooks and later saves them using the code below:
then later using:![]()
Please Login or Register to view this content.
when run in 2003 this works fine. However when it is run with office 2010 the saved file is corrupted. Presumably this is because office 2010 is being forced to save files with .xls extension. I could of course change the code to save with .xlsx format but then no doubt it would have problems when run on other machines running 2003.![]()
Please Login or Register to view this content.
So ideally I need a way to cover both. Is there for VBA to return the current version, if so I could change the code to
If (version 2010) then save as..........etc.
Or is there a better way?
Bookmarks