Dictionary troubles. Declaring and checking .exists

  • Thread starter Thread starter Abe
  • Start date Start date
A

Abe

I have a dictionary, declared in a module as:
Public dictCornerCellPics

Workbook_Open() contains the Set of the dictionary, as below:
Set dictCornerCellPics = CreateObject("Scripting.Dictionary")


A userform in the project contains a cmdButton_click() line of:
If dictCornerCellPics("a").exists then

This returns a "Run time error: Object Required"

Do all of the uses of dictCornerCellPics have to be in the module that
it is declared in?

What else may be wrong?
 
Abe

Change
dictCornerCellPics("a").exists
to
dictCornerCellPics.exists("a")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Back
Top