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.

Grab Data from All Worksheets in a Workbook

 Keywords:  

;	Start excel here
excelxls = objectopen("Excel.Application")
excelxls.visible = @true
rptxls = excelxls.workbooks
;	specify the workbook to look thru...
excelfile = "c:\temp\test.xls"
rptxls.open (excelfile)

awb = excelxls.activeworkbook
awbws = awb.worksheets

for x = 1 to awbws.count
	currws = awb.worksheets(x)
	currwsname = currws.name
	message("Worksheet", currwsname)
;	on the current workbook, look thru the first 10 rows of the A column...
	for row = 1 to 10
		col = 1
		actSheet = excelxls.activesheet
		thecell = actSheet.Cells(row,col)
		message("Row %row% Column %col%", thecell.value)
	next
next

excelxls.quit
objectclose(excelxls)

Article ID:   W15634
File Created: 2003:05:13:11:29:20
Last Updated: 2003:05:13:11:29:20