Results 1 to 2 of 2
2015-07-14, 20:14 #1
- Join Date
- Aug 2010
- Pa, USA
- Thanked 620 Times in 565 Posts
A Bit of Nostalgia While Choosing which Excel to Open a File
This is in response to a thread to old to respond to opened by our resident Larvae Extractor Specialist (LES), zeddy!
This question relates to PCs which may have several versions of Excel installed on the PC, e.g. Excel2003, Excel2007, Excel2010.
I want to open a specific Excel file in a specific version of Excel
To do this, I am planning to use a simple 'startup' file (e.g. "startupXYZ.xls")
This startup file can use a formula cell to check which version of Excel it opened in.
If it is already in the version of Excel I want, no problem, I can proceed to have the startup file then load my required file, and then close itself.
If the startup file detects that it is loaded in an Excel version other than the version I want, I want the startup file to check whether the version of Excel I want is available on that PC.
Is there a way of using VBA to check the Registry for available Excel versions???
Is it then possible, using VBA, to then open another instance of Excel, in particular, open either specifically Excel2007 or Excel2010????
I am sure you can do this blind-folded but you posed an interesting question that had me doing a little research. Here is what I came up with.
The attached file will open with The Open File dialogue box asking you the navigate to and select the file you wish to open. Once selected, a form will open indicating the versions of Excel installed on your computer, the current version opened, and option buttons allowing you to select the version you wish to open the selected file. Pressing Go, the starter file will then close and the selected version will open.
Since I only have version 2010 installed on this computer, I can only assume that since the version startup paths are correct and it works for my 2010, it will open the other versions as well. Since you have every Excel version installed on you computer since 1956 and you once worked as an Obsolete Applications Dismantler (OAD), you might give this a go. If you happened to have created you own version of this startup file, I would be most interested in the technique you might have used.
2015-07-15, 11:06 #2
- Join Date
- Mar 2002
- Newcazzle, UK
- Thanked 466 Times in 444 Posts
..so, after nearly five years I get a reply from the forum??????
I've been in Intensive Critical Care six times since then!!!
So, as I am still here, I would like to thank you for your efforts!
As you probably guessed, I sorted that issue out, but I was very pleased to see your input.
I tested your file when I had 7 instances of Excel running (1xExcel2003, 1xExcel2007, 2xExcel2010, 2xExcel2013, 0xExcel2016)
A minor update to your code was required to detect my Excel2003 and Excel2007:
Private Sub UserForm_Activate() ver = Application.Version Select Case ver Case "15.0" 'EXCEL 2013 Label6.Top = 50 Label7.Top = 52 OptionButton1.Value = True Case "14.0" 'EXCEL 2010 Label6.Top = 68 '45 Label7.Top = 66 '43 OptionButton2.Value = True Case "12.0" 'EXCEL 2007 Label6.Top = 86 Label7.Top = 84 OptionButton3.Value = True Case "11.0" 'EXCEL 2003 Label6.Top = 104 Label7.Top = 102 OptionButton4.Value = True End Select If CheckPath("C:\Program Files\Microsoft Office 15\root\office15\EXCEL.EXE") Then CheckBox1 = True If CheckPath("C:\Program Files (x86)\Microsoft Office\Office14\Excel.exe") Then CheckBox2 = True 'If CheckPath("C:\Program Files (x86)\Microsoft Office\Office12\Excel.exe\Excel.exe") Then CheckBox3 = True If CheckPath("C:\Program Files (x86)\Microsoft Office\Office12\Excel.exe") Then CheckBox3 = True '<< zeddy If CheckPath("C:\Program Files\Microsoft Office\Office\Xlstart\Excel.exe") Then CheckBox4 = True If CheckPath("C:\Program Files (x86)\Microsoft Office\Office11\Excel.exe") Then CheckBox4 = True '<< zeddy End Sub
Last edited by zeddy; 2015-07-15 at 12:20.