I would like to run an automatic Spell checking for my Excel workbook.
Previously I used the method explained in this query:
Spell check an Excel sheet in VBA
Everything seems to be alright, although at the very end I am getting an error:
Run-time error '1004': CheckSpelling method of Range class failed
However, my spellchecking looks like is done, since I have no same errors anymore. Unfortunately, it's quite awkward, because I cannot run another VBA code on my workbook since the debugger shows error.
I found the code relevant for Spellchecking of the protected sheet here:
https://www.computergaga.com/blog/spell-check-a-protected-excel-worksheet/
and finally I prepared my own code including them two:
Sub Spellcheck3()
For Each sh In Worksheets
Sheets(sh.Name).Cells.Unprotect "excel"
ActiveSheet.CheckSpelling
Sheets(sh.Name).Cells.Protect "excel"
Next
End Sub
Unfortunately, I am getting error: Object doesn't support this property or method.
The debug line is rough:
Sheets(sh.Name).Cells.Unprotect "excel"
Maybe should I target some set of cells on each worksheet as per the query below: Excel - VBscript for Spellcheck
I would like to have correct spellchecking with the comment at the end, that everything has been finished correctly. I have some cells protected across my workbook, and that's why the debugger appears.