arnabmit
New Member
- Joined
- Mar 28, 2009
- Messages
- 27
- Office Version
- 365
- 2019
- 2016
- Platform
- Windows
Hi,
I am trying to get the content of a formatted table into an ActiveX list box lstPrev. I am getting error 438 "Object doesn't support this property or method".
What am I doing wrong?
Note: ShtName is a public variable
I am trying to get the content of a formatted table into an ActiveX list box lstPrev. I am getting error 438 "Object doesn't support this property or method".
What am I doing wrong?
Note: ShtName is a public variable
VBA Code:
Dim dbSheet As Worksheet
Dim dbTable As ListObject
Set dbSheet = ThisWorkbook.Sheets("Form")
Set dbTable = ThisWorkbook.Sheets(ShtName).ListObjects(ShtName)
ActiveSheet.lstPrev.RowSource = dbTable.DataBodyRange.Address(External:=True)