문제

I am adding to a rather large workbook, with many sheets and macros, unfortunately they are not my domain to change... these include a module called Control, a sheet in the spreadsheet called Control and another sub in a different module using "Dim Control As Object" and then "Set Control = Worksheets(CONTROL_SHEET)"

My problem is I need to use "Dim chb As Control" but when my module is called I get the error:

Compile error: A module is not a valid type

Is there a way to define which Control I'm using in the Dim statement e.g. "Dim chb As Vartype.Control" ?

도움이 되었습니까?

해결책

I think you should be able to specify it using MSForms as the root:

Public Sub test()
Dim x As MSForms.Control
End Sub
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top