嘿我想采取下面的循环,如果分享以“_ o _ ”开头,也会跳过管理员共享
我的循环是:
'Compares The UnApproved Shares to the Current Shares
For Each objItem In colItems
Dim StrNonUnapprovedShares, Item
StrCurrentShares = objItem.name
if instr(AdminShares,lcase(objitem.name)) > 0 or mid(objitem.name,2,1) = "$" or left(lcase(objitem.name),10) = "pkgsvrhost" or instr("_o_") > 0 then
'Skipping known admin share
Else
For each Item in arrUnApprovedLines
If Lcase(Item) = Lcase(strCurrentShares) Then
StrNonUnapprovedShares = (StrNonUnapprovedShares & strCurrentShares & vbCrLf)
End If
Next
End If
Next
我在第5行的“pkgsvrhost”之后插入了一个“或instr(”_ O _ “)”,但它错误地出现了错误 - type mismatch“'[string:” _ O _ “] -
答案 0 :(得分:0)
试试这个:
Or Instr(objitem.name, "_O_") > 0