Was workbook opened with Excel 2007?

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

I have a workbook with formulas that only work in Excel '07 (using the
iferror function). When the workbook is opened, I want to check if the user
opened it with an earlier version of Excel. If they did, I want to tell them
to open it with Excel '07 and then automatically close the workbook.

I think I can handle writing all of the code except the part where I check
what version of excel they are using. The only member of the Application
object that I found which might be useful was Application.Version, but I
don't know if this can be trusted (returns 12.0 for me).

Has anyone else written code to perform the above validation? I would
rather not change all of my functions to include IF stmts instead of
IFERROR...
 
should be fine.

Option Explicit

Private Sub Workbook_Open()
If Application.Version <> 12 Then
MsgBox "whatever you want to say"
ActiveWorkbook.Close savechanges:=False
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top