[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Detect Version of Office within Access 2007 code

Posted on 2011-09-26
9
Medium Priority
?
222 Views
Last Modified: 2012-06-21
Based on which version of Office (2007 or 2010) that a user has installed on the local machine, I need to take certain action. Is there any easy way to detect this?
0
Comment
Question by:terpsichore
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 36599834
try
application.version
0
 
LVL 58
ID: 36599922
There's also the SYSCMD call:

Function GetVersion() As String
' Determine the version of Microsoft Access
' used to create this application.

      GetVersion = SysCmd(acSysCmdAccessVer)

End Function


Jim.
0
 
LVL 26

Expert Comment

by:Nick67
ID: 36599929
Ditto to @capricorn1

If Application.Version > 11 Then
    'because this is the use I have for knowing if things are A2007+
    'sub in what you need
    Call SaveAsOfficePDF(stDocName)
    Exit Sub
End If

'--------------------------------------------------------------------------
Private Sub SaveAsOfficePDF(stDocName As String)
Dim FormatValue As String
If Application.Version > 11 Then
    FormatValue = "PDF Format (*.pdf)"
Else
    FormatValue = acFormatRTF
End If
'yes if it's RTF the file ending will be screwy--but it should never get that far anyway
DoCmd.OpenReport stDocName, acPreview
DoCmd.OutputTo acOutputReport, stDocName, FormatValue, "c:\tempPdf\" & Reports(stDocName).Caption & ".pdf"
DoCmd.Close acReport, stDocName, acSaveYes
End Sub
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:terpsichore
ID: 36599947
just to be clear - I need the application installed on the machine, NOT the version of the application that created this Access app... please confirm solution if you would. Thanks.
0
 
LVL 58
ID: 36599956

 BTW, if you need the build number (which includes service packs and hotfixes), see the procedure here:

http://allenbrowne.com/ser-53code.html

Jim.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36599962
just to be clear,
what is your intention after you found the version installed on the machine?

you need to run a .bat file ?
0
 
LVL 26

Expert Comment

by:Nick67
ID: 36599986
Confirmed
Application.Version detects the running version of MS Access.
It is not concerned with the mdb or Accdb file type, but rather the version of the executable.
0
 

Author Closing Comment

by:terpsichore
ID: 36600015
excellent dialog with the group, very insightful and quick.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36600047
terpsichore,

you could have split the points for the comments that have given you more info..

click on Request Attention and ask that the thread be reopen to allocate points properly..
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question