I have a short macro in my PERSONAL workbook which works in all known workbooks on my work computer except for one.
I can't figure out what was special about that one. I set the same macro up on my home computer and it works on some, errors out on others. Here it is. I emboldened the section which is highlighted yellow when I run debugger.
Sub Autosize_Comments()
'
' Autosize_Comments Macro
' Auto-sizes all comments in range
'
' Keyboard Shortcut: Ctrl+Shift+C
Dim xComment As Comment
For Each xComment In Application.ActiveSheet.Comments
xComment.Shape.TextFrame.AutoSize = True
Next
End Sub
Could someone please point out what is going wrong here?
Or point me in the right direction on what to investigate?
I can't remember ever having a macro that works sporadically in the way that this one is.
In both cases I am running Excel 2016 on Windows 10.
Thank you very much for any help.
Bookmarks