Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
The following Visual Basic
Sub procedure illustrates how to work around the problem. You can use the
Version property of the
Application object to determine the version of Excel that you are running. Then, after you know the current version of Excel, you can use the correct name for the wizard. This procedure works in Excel 97 and Excel 2000:
Sub CreateWebPage()
Dim objtoconvert(0) As Variant
Dim WizardName As String
' If you are running Excel 2000...
If Application.Version Like "9.0" Then
' Use the new name for the wizard.
WizardName = "Internet Assistant VBA"
Else
' Use the old name for the wizard.
WizardName = "Internet Assistant Wizard"
End If
Set objtoconvert(0) = Sheets("sheet1").Range("a1:b2")
'Use the variable defined above for the name fo the wizard.
AddIns(WizardName).Installed = True
htmlconvert objtoconvert, False, False, False, 1252, "c:\test.htm", _
"Test Page", True, "Myname"
End Sub