Oday Salim
Oday Salim

Reputation: 1147

Compile error: variable not defined (VB Adodb)

I had a code, which was running perfectly fine yesterday, but now it stopped working and throwing this error:

enter image description here

I have checked my references, and my activeX box is checked:

enter image description here

I am really stuck. What am I doing wrong? Do I need to update something?

Upvotes: 1

Views: 6480

Answers (1)

Miqi180
Miqi180

Reputation: 1691

This type of error typically emerges after adding Option Explicit at the top of a module, or after pasting working code without explicitly defined variables into a new module with Option Explicit at the top.

Go to Tools > Options > Editor Tab and see if the checkbox for "Require Variable Declaration" is ticked. This is what Option Explicit does.

Upvotes: 6

Related Questions