Skip to main content

Error: Object variable or With block variable not set

Hi Brian,
 
Finally I have created my first pro dialog box in IDEA and that's amazing for my future projects.
I wanted to add benford law into the macros (dialog box) but i have got an error: Object variable or With block variable not set!
Please have a look at the attached pic.
Also, some tables may have less than 1000 puplulation so I will receive an error if the number of records is less than 1000 for creating suspicious.
That would be great if you let me know how to script the number of records e.g.
 
if "number of population" <1000 then eqn = "number of population"
task.MinimumRecordsForCreatingSuspicious = eqn
 
Thanks,
 

Brian Element Wed, 03/02/2022 - 12:25

In the lower right hand corner you can find the line number you are on:

Let me know what line it is that it is pointing to.

Brian Element Wed, 03/02/2022 - 14:39

I see what your problem is, you need to be defining all those variables as Integer and not what you are doing.  So:

Dim FIRST1DIGIT_ANALYSIS as FIRST1DIGIT_ANALYSIS 

should be:

Dim FIRST1DIGIT_ANALYSIS as Integer

There is no variable type called FIRST1DIGIT_ANALYSIS and that is why you are getting that error.

talebi Wed, 03/02/2022 - 14:44

Thanks Brian!!!
How about my second question about the number of records in a table

talebi Tue, 03/08/2022 - 15:21

Hi Brian, I was wondering if I could write a script to export the benford's bar charts. You helped me to write scripts to create benford law for a database but I also need to export the bar charts along with the tables. Please have a look at the picture I have attached.