Exception Notice for Read and Write Excel: Dividing by 0?

I just downloaded and installed Read and Write Excel - I want to use it for batch processing, but right now it’s not working even once - I’m getting an error saying I’m trying to divide by 0. All I need to type is run(“Read and Write Excel”); after the result I want to save, right? (I’m trying to get 73 results tables to output to the same file.) I saw an answer for a similar question saying to disable “Results->Options->Copy Column Headers” but I don’t know where to do that and I’m not sure I have the same problem - their error message was different from mine. Mine is below.

Add: I actually wasn’t sure if “exception” meant error because the code kept running and iterating through the results tables for all 73. But there are no excel outputs.
Add 2: I also tried the file.append function but I couldn’t figure out how to append a table, only strings. When I would put “Results” it would append the word “results” and when I left the quotes off it gave me an error.

What kind of results are you trying to save? I can’t replicate the issue with a measurement from one of the sample files. Does the following macro create the expected file on your desktop?

run("Dot Blot (7K)");
setThreshold(0, 162);
run("Convert to Mask");
run("Analyze Particles...", "display clear");
run("Read and Write Excel");

You can find that setting in the Fiji menu at Edit > Options > Input/Output…

Best,
Stefan

Your code worked fine for me, and the box from the other post is already unchecked. My code is a bit long but here are the lines that I believe are giving me trouble:

run(“3D Objects Counter”, “threshold=1 slice=1 min.=1000 max.=4325376 objects statistics summary”);
run(“Read and Write Excel”);

Does that clear anything up?

It does: the 3D Objects Counter does not generate a results table (i.e. one generated by Analyze > Measure) that is called “Results”, which is expected by Read and Write Excel plugin. The following solved the issue for me:

run("3D Objects Counter", "threshold=1 slice=1 min.=1000 max.=4325376 objects statistics summary");
IJ.renameResults("Results");
run("Read and Write Excel");
1 Like

Thanks that worked! But I want each table to have a title in the spreadsheet and right now they just say imgDUP, is that because I renamed everything to “Results”? The tables that pop up each have a title (“Nucleoli of nucleus” 1-73) but the other windows that pop up in parallel now just say “Results”.
EDIT: Actually, why the tables aren’t labelled differently is it’s the same table over and over again…I guess I wasn’t looking closely.

The plugin takes the name of the first open image if you don’t provide the name yourself. The following should work in your loop:

run("Read and Write Excel", "Nucleoli of nucleus "+i);

What do you mean exactly: the table is not updated?