Hi,
How can I check if a sheet with a specific name exist in an excel workbook, and select it, if exist?
If not exist, I need to do something else..
FUNCTION ExcelSheetNames(oExcel)
Local aNames:= {}
Local nLen:= oExcel:WorkSheets:Count
Local cName
FOR nI:= 1 TO nLen
cName:= oExcel:WorkSheets(nI):Name
Aadd(aNames, cName)
NEXT
RETURN aNames
hmpaquito wrote:Marc,
Try so, (no tested)
- Code: Select all Expand view
FUNCTION ExcelSheetNames(oExcel)
Local aNames:= {}
Local nLen:= oExcel:WorkSheets:Count
Local cName
FOR nI:= 1 TO nLen
cName:= oExcel:WorkSheets(nI):Name
Aadd(aNames, cName)
NEXT
RETURN aNames
Regards
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Natter and 53 guests