Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


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)