FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   Add to FavoritesAdd to Favorites
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    RSS Get RSS Feed  


Automate Excel with VBScript

 
Post new topic   Reply to topic    Macro Scheduler and Windows Automation Forum Index -> Scripts and Tips
View previous topic :: View next topic  
Author Message
mtettmar
Site Admin


Joined: 19 Sep 2002
Posts: 4221
Location: Dorset, UK
Reputation: 621
votes: 28
Earn Points, Win a T-Shirt

PostPosted: Fri Feb 21, 2003 12:00 am    Post subject: Automate Excel with VBScript Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:    View previous topic :: View next topic  
Post new topic   Reply to topic    Macro Scheduler and Windows Automation Forum Index -> Scripts and Tips All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group