Saving excel file as html file

Hi Guys,

I am a newbee as far as VB is concerned. I am trying to save an excel sheet as html file from MS Visual Studio - VB, but I am getting error. A sample of my code is

Sub create_html()

Dim applicationAs Microsoft.Office.Interop.Excel.Application

Dim bookAs Microsoft.Office.Interop.Excel.Workbook

Dim sheetAs Microsoft.Office.Interop.Excel.Worksheet

Dim file_format As HtmlDocument

.....

Sheet.SaveAs("D:\Documents and Settings\Sanket\My Documents\chart.html", file_format)

End Sub()

Do I need to 'Add Reference' for the project ? What should be done ?

thanks,

Sanket

[1124 byte] By [SanketKhandelwal] at [2007-12-29]
# 1

Yes you would need to add the reference to the Excel Object Model - if your using Excel 2003 then it will be version 11.0

That should make some of the errors go away.

spotty at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2
Hi I did the same but it didn't work. Can you pls post full code here. Thank you.
ChuoiTieu at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic General...