mtettmar Site Admin

Joined: 19 Sep 2002 Posts: 4221 Location: Dorset, UK Reputation: 621   votes: 28 Earn Points, Win a T-Shirt
|
Posted: Fri Feb 21, 2003 12:00 am Post subject: Automate Excel with VBScript |
|
|
Contributed By: Marcus Tettmar mtettmar@mjtnet.com Submitted On: 21/02/03
VBSTART Sub ExcelExample Dim xlApp Dim xlBook Dim xlSheet
Set xlApp = CreateObject("Excel.Application") Set xlBook = xlApp.Workbooks.Add Set xlSheet = xlBook.Worksheets(1)
xlApp.visible = True 'optionally make the sheet visible 'xlSheet.Application.Visible = True xlSheet.Cells(1,1).Value = "This is the column A, row 1" 'etc xlSheet.SaveAs "C:\files\mysheet.xls" xlApp.Quit
Set xlSheet = Nothing Set xlBook = Nothing Set xlApp = Nothing End Sub VBEND VBRun>ExcelExample
Did this message help you? If so please reward the poster with Reputation Points? Reward Points
|
|