下面的代碼在調用InStr函數返回的錯誤5:如何在VBA 2003中使用InStr函數?
Option Explicit
Sub Test()
Dim wb As Workbook
Dim wbs As Workbooks
Dim str As String
Dim LPosition As Integer
Set wbs = Application.Workbooks
For Each wb In wbs
str = wb.Name
LPosition = InStr(0, str, "_", vbTextCompare)
MsgBox LPosition
Next wb
End Sub
可能有人請解釋一下爲什麼?
節這給誤差在5 INSTR電話。無法解決問題?請幫助我 –