740
社区成员
发帖
与我相关
我的任务
分享
OleObject xlapp
Integer li_row
String ls_filename, ls_version, ls_info
xlapp = Create oleobject
li_row = xlapp.ConnectToNewObject("Excel.Application")
If li_row < 0 Then
Messagebox("系统提示","不能运行Excel程序,请检查是否已安装Microsoft Excel软件!",Stopsign!)
Else
ls_version = String(xlapp.Version)
Choose Case ls_version
Case '9.0'
ls_info = "Excel 2000"
Case '10.0'
ls_info = "Excel 2002/XP"
Case '11.0'
ls_info = "Excel 2003"
Case '12.0'
ls_info = "Excel 2007"
Case '14.0'
ls_info = "Excel 2010"
Case Else
ls_info = "未知版本"
End Choose
Messagebox("系统提示", ls_info + " 版本号:" + ls_version + "~t")
xlapp.DisconnectObject()
End If