|
-
Jul 15th, 2009, 04:27 PM
#1
Thread Starter
Lively Member
[RESOLVED] [Excel] Detecting Excel Version with VBA
Is there a way to detect which version of Excel is running from within a Macro?
What I need to do it get some code to run in both 2003 and 2007. Problem is that at least two sections of the code won't run in one version or the other, so I need to detect which version it is to get the code to run properly.
example:
if Excel2007 then
2007 code runs here
else
2003 code runs here
end if
Any suggestions?
Thanks
datapard
If you have to do it more than once...
Automate it!
-
Jul 15th, 2009, 04:47 PM
#2
Re: [Excel] Detecting Excel Version with VBA
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Jul 15th, 2009, 05:08 PM
#3
Thread Starter
Lively Member
Re: [Excel] Detecting Excel Version with VBA
 Originally Posted by westconn1
application.version
Thanks westconn1. Do you happen to know what the designators for 2003 and 2007 are?
Thanks again,
datapard
Edited:
Never mind, I just found the answer. Thank you for your assistance. 
datapard
Last edited by datapard; Jul 15th, 2009 at 11:07 PM.
If you have to do it more than once...
Automate it!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|