How would i open an instance of excel, all through my program, then populate a sheet with say
a table like this :
Name | Eye COlor | Nickname | Etc
---------------------------------
David|Blue |Da_Silvy | Etc
and then print it out
does anyone know?
Printable View
How would i open an instance of excel, all through my program, then populate a sheet with say
a table like this :
Name | Eye COlor | Nickname | Etc
---------------------------------
David|Blue |Da_Silvy | Etc
and then print it out
does anyone know?
please help, it's urgent
Hi David
First you have to reference the Excel library in Projects/Reference Menu in VB6.
Then you create a ExcelApp Object and a Worksheet object.
The Worksheet Object has a Cells or a Range object that you can manipulate.
Try the following code:
Dim objExcel as Excel.Application
Set objExcel = New Excel.Application
objExcel.Visible = True
objExcel.SheetsInNewWorkbook = 1
objExcel.Workbooks.Add
With objExcel.ActiveSheet
.Range("A1").value = "Heading 1"
.Range("B1").value = "Data 1"
etc, etc,etc....
End With
thank you very much :)
yeah, thanks