WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with Excel
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

OLE and Excel - Spreadsheet Calculation Example

Keywords: 	   excel spreadsheet calculation

; Performs a calculation in an Excel spreadsheet.

;------------------------------
amount  = "50.00"
taxrate = ".0865"
;------------------------------

Book = ObjectOpen("Excel.Sheet")
Sheet = Book.ActiveSheet
CellA1 = Sheet.Range("A1")
CellA2 = Sheet.Range("A2")
CellA3 = Sheet.Range("A3")

CellA1.Value = amount
CellA2.Value = taxrate
CellA3.Formula = "=A1*A2"

tax = CellA3.Value

ObjectClose(CellA3)
ObjectClose(CellA2)
ObjectClose(CellA1)
ObjectClose(Sheet)
ObjectClose(Book)

Message("Tax", tax)

Article ID:   W14281
Filename:   OLE and Excel - Spreadsheet Calculation.txt
File Created: 1999:10:26:11:23:00
Last Updated: 1999:10:26:11:23:00