How to create excel 2003 spreadsheet from vb.net

tarunkapoor

Member
Joined
Apr 10, 2005
Messages
17
Programming Experience
3-5
I have this code which used to work perfectly with Excel 2000

///////////////////////////////////////////////////////////////////////
Dim xl As New Excel._ExcelApplication
xl.Workbooks.Add()


Dim dc As DataColumn = New DataColumn
Dim i As Integer = 0

For Each dc In ds.Tables(0).Columns
xl.Range("A1").Offset(0, i).Value = dc.ColumnName
i += 1
Next

---- more code-------

xl.SaveWorkspace("C:\temp1.xls")
/////////////////////////////////////////////////////////////////////////

Now this code doesnt work with Excel 2003 at all. Can anybody help me convert this for Excel 2003. Any help will be greatly appreciated.

Tarun


 
Top Bottom