View Single Post
 
Old 08-11-2022, 08:18 PM
shanshan89 shanshan89 is offline Windows 10 Office 2019
Novice
 
Join Date: Jul 2022
Posts: 17
shanshan89 is on a distinguished road
Smile

Hi!

I have uploaded the dotm word file and the excel where the data for the simple word dropdown list is stored.

As mentioned, I have 3 identical tables. For each table under column 3, I have a simple dropdown list. The user has the flexibility to delete any of the tables depending on whether he needs the table.

However, when any of the tables are deleted, there will be an error "Run-time error '5941':The requested member of the collection does not exist".

Hence I was wondering, if there is any way to modify the code such that if e.g. Dropdown List 1 or Dropdown List 2 or Dropdown List 3 does not exist, ignore and go to the next line of code. I think it's similar to Python's "try, except, pass" method but I don't know how to write it on word VBA. I tried to add "On Error Resume Next" to my word VBA code but it doesn't work.

Hope this clarifies!

Thanks.
Attached Files
File Type: dotm EXAMPLE WITH 3 TABLES & 3 SIMPLE DROPDOWN LIST.dotm (76.8 KB, 7 views)
File Type: xlsx Excel Data Store.xlsx (9.1 KB, 7 views)
Reply With Quote