Dictionary troubles. Declaring and checking .exists

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?
 
C

Chip Pearson

Abe

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


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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top