Dim xlapp
Dim xlworkbook
Dim xlworksheet
Set xlapp =createobject("excel.application")
Set xlworkbook=xlapp.Workbooks.Add
Set xlworksheet=xlworkbook.Worksheets.Add
xlworksheet.Cells(1,1)="Text in row 1 and column 1"
'this above statement can also be written as xlworksheet.cells(1,"A")="....."
xlworkbook.SaveAs "c:\newbook.xls"
xlworkbook.Close
xlapp.Quit
Set xlworksheet=nothing
Set xlworkbook=nothing
Set xlapp=nothing
Dim xlworkbook
Dim xlworksheet
Set xlapp =createobject("excel.application")
Set xlworkbook=xlapp.Workbooks.Add
Set xlworksheet=xlworkbook.Worksheets.Add
xlworksheet.Cells(1,1)="Text in row 1 and column 1"
'this above statement can also be written as xlworksheet.cells(1,"A")="....."
xlworkbook.SaveAs "c:\newbook.xls"
xlworkbook.Close
xlapp.Quit
Set xlworksheet=nothing
Set xlworkbook=nothing
Set xlapp=nothing
No comments:
Post a Comment