VBScript Examples

''Example on Internet Explorer
Set ie = CreateObject("InternetExplorer.Application")

'set the ie properties
ie.ToolBar = 0
ie.StatusBar = 1
ie.Width = 999
ie.Height = 999
ie.Left = 0
ie.Top = 0
ie.Visible = 1

'navigate to a web page
ie.Navigate("http://www.google.com")
===================================
''Example on using Excel, VBScript

dim ex,wb,ws,row,column
set ex=CreateObject("Excel.Application")
ex.visible=true
set wb=ex.Workbooks.add
set ws=wb.Sheets("Sheet1")

for row=1 to 5
for column=1 to 10
ws.cells(row,column).value="Cell(" & row & "," & column & ")"
next
next

dim val
for row=1 to 5
for column=1 to 10
with ws.cells(row,column)
.value="updated_" & .value
end with
next
next

for column=1 to 10
ws.columns(column).AutoFit()
next

Comments