Hi
This is my code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim oXL As Excel.Application
Dim oWB As Excel.Workbook
Dim oSheet As Excel.Worksheet
' Start Excel and get Application object.
oXL = CreateObject("Excel.Application"
oXL.Visible = True
' Get a new workbook.
oWB = oXL.Workbooks.Add
oSheet = oWB.ActiveSheet
' Add table headers going cell by cell.
oSheet.Cells(1, 1).Value = "First Name"
oSheet.Cells(1, 2).Value = "Last Name"
oSheet.Cells(1, 3).Value = "Full Name"
oSheet.Cells(1, 4).Value = "Salary"
' Format A11 as bold, vertical alignment = center.
With oSheet.Range("A1", "D1"
.Font.Bold = True
.VerticalAlignment = Excel.XlVAlign.xlVAlignCenter
End With
End Sub
I got this code from the microsoft website:
I'm running visual studio.NET 2003 on a windows xp pro system with office xp pro on it.
I added the necessary references to my project.
(com reference to excel 10.0 library)
The following error is what i get:
Old format or invalid type library.
I already re-installed my office xp but that resolved nothing.
I'm getting very desperate.
Anyone any thoughts.
Any help is welcome.
Thnx.
This is my code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim oXL As Excel.Application
Dim oWB As Excel.Workbook
Dim oSheet As Excel.Worksheet
' Start Excel and get Application object.
oXL = CreateObject("Excel.Application"
oXL.Visible = True
' Get a new workbook.
oWB = oXL.Workbooks.Add
oSheet = oWB.ActiveSheet
' Add table headers going cell by cell.
oSheet.Cells(1, 1).Value = "First Name"
oSheet.Cells(1, 2).Value = "Last Name"
oSheet.Cells(1, 3).Value = "Full Name"
oSheet.Cells(1, 4).Value = "Salary"
' Format A11 as bold, vertical alignment = center.
With oSheet.Range("A1", "D1"
.Font.Bold = True
.VerticalAlignment = Excel.XlVAlign.xlVAlignCenter
End With
End Sub
I got this code from the microsoft website:
I'm running visual studio.NET 2003 on a windows xp pro system with office xp pro on it.
I added the necessary references to my project.
(com reference to excel 10.0 library)
The following error is what i get:
Old format or invalid type library.
I already re-installed my office xp but that resolved nothing.
I'm getting very desperate.
Anyone any thoughts.
Any help is welcome.
Thnx.