I’m trying to get number of visible worksheets in a workbook.
This is the vba code:
Sub VisibleSheets(Byref wb as workbook)
Dim sheets as Object = wb.Sheets
Dim count as Integer
count=0
If sheets IsNot Nothing Then
For Each sheet as Object in sheets
if sheet.visible = true then
count=count+1
end if
Next
End If
return count
I use invoke vba and have the code which is above in it. As EntryMethodParameters I am passing {WorkbookName} where WorkbookName is the output of excel application scope activity. I am getting type mismatch error.