CodeItBetter Programming Another VB Programming Blog

How to create an Excel file from your application

Posted on January 5, 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
'MS Office - How to create an Excel file from your application

Private Sub Main()
    Dim xlApp As Excel.Application
    Dim xlWB As Excel.Workbook
    Dim xlWS As Excel.Worksheet
    Set xlApp = New Excel.Application
    Set xlWB = xlApp.Workbooks.Add
    Set xlWS = xlWB.Worksheets.Add
    xlWS.Cells(2, 2).Value = "http://codeitbetter.com"
    xlWS.Cells(1, 3).Value = "Your handy Source Code Library"
    xlWS.SaveAS "C:\Temp\Test.xls"
    xlApp.Quit
    Set xlWS = Nothing
    Set xlWB = Nothing
    Set xlApp = Nothing
End Sub
Filed under: MS Office Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.