vb.net Excel版本 [英] vb.net Excel versions
问题描述
嗨
在VB.Net中,有没有办法编写一个基于Windows的程序,它将使用多个版本的Office(Excel)?
? br />
示例:如果办公室2000,那么如果办公室2003那么。
这可能吗?例子?
谢谢
Hi
Is there a way, in VB.Net, to write a windows based program that will use
more than one version of Office (Excel)?
Example: if office 2000 then else if office 2003 then.
Is this possible? Examples?
Thanks
推荐答案
嗨
BrianDH写道:
Hi
BrianDH wrote:
嗨
有没有办法,在VB.Net中,编写一个基于Windows的程序,
将使用多个版本的Office(Excel )?
示例:如果办公室2000,那么如果办公室2003那么。
这可能吗?示例?
Hi
Is there a way, in VB.Net, to write a windows based program that
will use more than one version of Office (Excel)?
Example: if office 2000 then else if office 2003 then.
Is this possible? Examples?
Late-Binding是你的朋友
Dim xlAppl As Object = CreateObject(" Excel.Application")
Frank
Late-Binding is your friend
Dim xlAppl As Object = CreateObject("Excel.Application")
Frank
使用注册表检查版本....
伪代码未经测试。
公共函数getInstance1()如Excel.ApplicationClass
Dim regVersion As RegistryKey
Dim keyValue As String
Dim versionnumber As Integer = 9
Do
keyValue =" Software \\ Mysoftoft \\Office\\ &安培; versionnumber&
" .0 \\\\ excel"
regVersion = Registry.LocalMachine.OpenSubKey(keyValue,
False)
如果regVersion什么都没有那么
''这样做并退出
结束如果
如果versionnumber = 10那么
''这样做
结束如果
退出运行
循环
结束功能
" BrianDH" <峰; br ***** @ discussions.microsoft.com>在消息中写道
news:95 ********************************** @ microsof t.com:
Use the registry to check the version....
Pseudo code untested.
Public Function getInstance1() As Excel.ApplicationClass
Dim regVersion As RegistryKey
Dim keyValue As String
Dim versionnumber As Integer = 9
Do
keyValue = "Software\\Microsoft\\Office\\" & versionnumber &
".0\\Excel"
regVersion = Registry.LocalMachine.OpenSubKey(keyValue,
False)
If regVersion Is Nothing Then
''Do this and exit
End If
If versionnumber = 10 Then
''Do this
End If
Exit Do
Loop
End Function
"BrianDH" <Br*****@discussions.microsoft.com> wrote in message
news:95**********************************@microsof t.com:
嗨
有没有办法,在VB.Net中,编写一个基于Windows的程序,将使用多个版本的Office
(Excel)?
示例:如果办公室2000,那么如果办公室2003那么。
这可能吗?例子?
谢谢
Hi
Is there a way, in VB.Net, to write a windows based program that will use
more than one version of Office (Excel)?
Example: if office 2000 then else if office 2003 then.
Is this possible? Examples?
Thanks
谢谢你试一试!
Frank Liebelt写道:
thanks will give it a try!
"Frank Liebelt" wrote:
嗨
BrianDH写道:
Hi
BrianDH wrote:
嗨
有没有办法,在VB.Net中,写一个基于Windows的程序,
将使用多个版本的Office(Excel)?
示例:如果办公室2000,那么如果办公室2003那么。
这可能吗?例子?
Hi
Is there a way, in VB.Net, to write a windows based program that
will use more than one version of Office (Excel)?
Example: if office 2000 then else if office 2003 then.
Is this possible? Examples?
Late-Binding是你的朋友
Dim xlAppl As Object = CreateObject(" Excel.Application")
Frank
Late-Binding is your friend
Dim xlAppl As Object = CreateObject("Excel.Application")
Frank
这篇关于vb.net Excel版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!