vb引用中没有Microsoft Excel 12.0 Object Library 怎么回事
vb引用中没有Microsoft Excel 12.0 Object Library 怎么回事
'获取当前Office版本的函数 Public Function GetInstalledOfficeVersion() As String On Error Resume Next Dim WD Dim OfficeVer As String OfficeVer = 0 GetInstalledOfficeVersion = "" Set WD = CreateObject("Word.Application.8") OfficeVer = CStr(WD.Version) WD.quit If Not WD Is Nothing Then Set WD = Nothing If InStr(OfficeVer, "8") <> 0 Then GetInstalledOfficeVersion = "Microsoft Office 97" ElseIf InStr(OfficeVer, "9") <> 0 Then GetInstalledOfficeVersion = "Microsoft Office 2000" ElseIf InStr(OfficeVer, "10") <> 0 Then GetInstalledOfficeVersion = "Microsoft Office XP 2002" ElseIf InStr(OfficeVer, "11") <> 0 Then GetInstalledOfficeVersion = "Microsoft Office 2003" ElseIf InStr(OfficeVer, "12") <> 0 Then GetInstalledOfficeVersion = "Microsoft Office 2007" ElseIf InStr(OfficeVer, "13") <> 0 Then GetInstalledOfficeVersion = "Microsoft Office 2010" ElseIf InStr(OfficeVer, "14") <> 0 Then GetInstalledOfficeVersion = "Microsoft Office 2012" End If If Err.Number = 424 Then Err.Clear GetInstalledOfficeVersion = "Not Install Microsoft Office or Over 2007" End If End Function