|
-
December 8th, 1998, 10:04 PM
#1
How VB can create a table in Excel worksheet.
I have encountered a problem the writing codes to create the tables in excel worksheet. Therefor I hope to get some suggestions and recommendation to solve my problem. Thanks a lots for your helps.
Vivien Lee
-
December 17th, 1998, 05:50 PM
#2
Re: How VB can create a table in Excel worksheet.
here is the part of code:
------------------------------------------------
Private Sub Command1_Click()
Dim x1 As Object
Dim sheet As Object
Set x1 = CreateObject("Excel.Application")
x1.Workbooks.Add
Set sheet = x1.ActiveWorkbook.Sheets(1)
x1.Visible = True
For i = 0 To 2
For j = 0 To 9
sheet.Cells(i + 1, j + 1).Value = i + j
Next j
Next i
sheet.SaveAs "c:\temp\data.xls"
x1.Quit
Set x1 = Nothing
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|