Runtime error 91 from ZEN macro by using sikulix

Asked by BOCHENG YIN

I am using sikulix 1.1.4. to automate a job on our Windows desktop. It kinds of triggers the error " runtime error 91, Object variable or With block variable not set" when it runs into the ZEN black macro, a macro to talk to the microscope to photobleach the pixels defined in a mask file in the format of text image.

As you see, our project contains a tedious workflow, and needs sikulix for automation. Here is the description:
We need to do photolabeling on our sample under microscope. The sample is divided into several tiles/ or positions. We need to loop through the tiles or positions and do photolabeling one-by-one.
We work on a Carl Zeiss microscope, use ZEN black and its macro (kind of VBA environment) to operate the microscope. And use imagej (https://imagej.nih.gov/ij/)
If digging into the details for the job at each tile/position, we acquire an image in ZEN black, and generate a mask as a binary text image file by imageJ. Then text image file will be read by the ZEN black macro.

Back to our problem. If we go through the steps slowly and manually, the ZEN black macro (VBA environment but not exactly the same) works fine most of the time. Occasionally, runtime error will appear, but will go away if starting with a new process.

The sikulix makes the error persist. It fails the macro almost every time. I use sikulix to type the mask file and log file path as strings to the macro with other numeric parameters and click a button to run it. Is it relevant to the error I described?

My description is kind of vague. Also, it is really hard to simulate the environment on our PC since the ZEN black and macro is open sourced. But at least, I want to hear if anybody has a similar experience. That a macro seems able to distinguish a robot and a human. I hope some experts can tell me if this is sikulix related or only the crappy macro related. Thanks!

Question information

Language:
English Edit question
Status:
Expired
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

No idea, what you are talking about.

In SikuliX I cannot find the generation of an error with the text
"runtime error 91, Object variable or With block variable not set"

How do you use SikuliX?

Revision history for this message
BOCHENG YIN (borishappy2009) said :
#2

Dear RailMan,
Sorry for this confusion. You are right. Sikuli cannot generate the error. The error comes out from the macro. However, the macro works fine alone but fails most of the time with Sikuli.
I record a video to show the contrast between with and without using Sikuli.
https://drive.google.com/open?id=1YABp72n8Ge273d82angok-giCJEN3Our

Revision history for this message
BOCHENG YIN (borishappy2009) said :
#3

Dear RailMan,

I opened a thread at StackOverflow.
https://stackoverflow.com/questions/52863976/sikulix-triggers-runtime-error-91-of-a-vba-analog-macro

I think it may explain my question more clearly. Thanks!

Revision history for this message
Launchpad Janitor (janitor) said :
#4

This question was expired because it remained in the 'Needs information' state without activity for the last 15 days.