|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to check Excel version number with .net?Hi everybody.
Does anyone know what code I should use to check for the version number of Excel, installed on a computer? Thanks. Alain. On Wed, 04 Jan 2006 20:28:30 GMT, "Alain \"Mbuna\"" <mb***@telenet.be> wrote:
¤ Hi everybody. ¤ ¤ Does anyone know what code I should use to check for the version number of ¤ Excel, installed on a computer? ¤ You can also use the FindExecutable API function call (which doesn't launch the Excel application): Declare Function FindExecutable Lib "shell32.dll" Alias "FindExecutableA" (ByVal lpFile As String, _ ByVal lpDirectory As String, _ ByVal lpResult As System.Text.StringBuilder) As Int32 Function IsExcelInstalled(ByRef FileVersionMajor As String) As Boolean Dim DummyFile As String Dim FileDir As String Dim FilePath As New System.Text.StringBuilder(255) DummyFile = "e:\My Documents\book1.xls" If FindExecutable(DummyFile, FileDir, FilePath) > 32 Then IsExcelInstalled = True FileVersionMajor = System.Diagnostics.FileVersionInfo.GetVersionInfo(FilePath.ToString).FileMajorPart End If End Function Paul ~~~~ Microsoft MVP (Visual Basic)
SQL Data Adapter
To VB or not to VB? To VB or not to VB? Excel automation??? VS2005 - Debug and Locked Files Debugging in VS2005 - why is some code shaded grey? SqlConnection component in VB.2005 For each ..... next Question Setup and Deployment and Microsoft Jet OLE DB Provider Dir(strPath, +R +A +S +H) keeps returning hidden folders |
|||||||||||||||||||||||