XL97: LastUpdated Argument of Htmlconvert Is Not Functional

Last reviewed: February 27, 1998
Article ID: Q172305
The information in this article applies to:
  • Microsoft Excel 97 for Windows

SYMPTOMS

When you programmatically create a Hypertext Markup Language (HTML) document with the Htmlconvert function, the value that you specify for the LastUpdated argument may not appear on the resulting HTML document.

CAUSE

This problem occurs if you do not include the DescriptionFullPage argument for the Htmlconvert function in your Visual Basic for Applications macro.

WORKAROUND

Microsoft provides examples of Visual Basic for Applications procedures for illustration only, without warranty either expressed or implied, including, but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. The Visual Basic procedures in this article are provided 'as is' and Microsoft does not guarantee that they can be used in all situations. While Microsoft support engineers can help explain the functionality of a particular macro, they will not modify these examples to provide added functionality, nor will they help you construct macros to meet your specific needs. If you have limited programming experience, you may want to consult one of the Microsoft Solution Providers. Solution Providers offer a wide range of fee-based services, including creating custom macros. For more information about Microsoft Solution Providers, call Microsoft Customer Information Service at (800) 426-9400.

To specify a value for the LastUpdated argument without including a value for the DecscriptionFullPage argument of the Htmlconvert function, specify a null string ("") as the value for the DescriptionFullPage argument of the Htmlconvert function. The following example specifies a value for the LastUpdated argument without including a value for the DecscriptionFullPage argument:

  1. Close and save any open workbooks, and then create a new workbook.

  2. Enter the following values on Sheet1:

          A1: 2
          A2: 4
          A3: 6
          A4:
          A5: This
          A6: is
          A7: a
          A8: Test
    

  3. Select cells A1:A3, and then click Chart on the Insert menu. In the "Chart Wizard - Step 1 of 4 - Chart Type" dialog box, click Finish.

The result is a worksheet that contains two data ranges and one chart.

  1. Start the Visual Basic Editor (press ALT+F11).

  2. To use the Htmlconvert method of the Html.xla add-in, create a reference to this add-in. To create the reference, do the following:

    a. Click References on the Tools Menu.

    b. Click to select the HTML check box, and then click OK.

          Go to step 6.
    

          If you do not see the HTML, in the Available References list,
          click Browse.
    

    c. Open the folder that contains the Html.xla file. By default, the

          Html.xla file is installed in the following folder:
    

             C:\Program Files\Microsoft Office\Office\Library
    
       d. Click "Microsoft Excel Files (*.xls, *,xla)" in the Files Of
          Type list.
    
       e. Click Html.xla in the list of files, and then click Open.
    
    

  3. If the Project Explorer window is not visible, click Project Explorer on the View menu. In the Project Explorer, click the workbook created in step 1.

  4. Click Module on the Insert menu to insert a Visual Basic module.

  5. Enter the following code into the module sheet:

          Sub CreateWebPage()
    
              Dim ObjToConvert(2) As Variant
    
              ' Populate the array of objects for HTMLConvert.
              Set ObjToConvert(0) = Sheets("sheet1").Range("a1:a3")
              Set ObjToConvert(1) = Sheets("sheet1").ChartObjects("Chart 1")
              Set ObjToConvert(2) = Sheets("sheet1").Range("a5:a8")
    
              ' Load Html.xla into memory.
              AddIns("Internet Assistant Wizard").Installed = True
    
              ' Create the HTML document.
              Htmlconvert rangeandcharttoconvert:=ObjToConvert, _
                  usefrontpageforexistingfile:=False, _
                  addtofrontpageweb:=False, useexistingfile:=False, _
                  codepage:=1252, htmlfilepath:="Test.htm", _
                  descriptionfullpage:="", lastupdate:=Now
    
          End Sub
    
    

  6. Run the CreateWebPage subroutine.

When you open the Test.htm page in an Internet browser, text that indicates when the page was last updated appears at the bottom of the page.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Note that the Htmlconvert function is not supported by the Html.xla add-in included with the original version of Microsoft Office 97. You must install Microsoft Office 97 SR-1 or download the updated Html.xla add-in from the Microsoft web site in order to be able to use the Htmlconvert function. following:

MORE INFORMATION

For additional information on how to programmatically save a worksheet as HTML, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q168561
   TITLE     :XL97: How to Programmatically Save a Worksheet as HTML

For additional information on the HTMLconvert function, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q168345
   TITLE     :XL97: Contents of Readme.txt for the Updated Html.xla Add-in


Additional query words: XL97
Keywords : kbcode kbprg xlvbahowto xlvbainfo
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbbug
Solution Type : kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 27, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.