我试图通过传递一定SHEETNAME作为参数调用一个子程序,但我收到以下错误:传递表要子程序
Object doesn't support this property or method
这里是我的代码:
Public Sub PerformanceLeague()
Dim wsPerformanceLeague As Worksheet
Set wsPerformanceLeague = Worksheets("PerformanceLeague")
SetHeadings wsPerformanceLeague
End Sub
Public Sub SetHeadings(sSheet As Worksheet)
Dim headers() As Variant
Dim ws As Worksheet
Dim wb As Workbook
Application.ScreenUpdating = False
End Sub
我试图调用的子程序,如下为好,但收到同样的错误:
Call SetHeadings(wsPerformanceLeague)
'wsPerformanceLeague =工作表( “PerformanceLeague”)'将其更改为'设置wsPerformanceLeague =工作表( “PerformanceLeague”) ' –
同时在'Dim wsPerformanceLeague作为工作表'声明它' –
您能告诉我们您收到哪条错误消息吗? –