• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1120
  • Last Modified:

Powershell and Excel Comments: Formating Question about Excel Comments

I've got two questions I need answered:

1) Is it possible to setup Excel some that comments inserted into a cell can be viewed using slider bars (bottom and right side sliders)?

2) How do you turn this on in either Office (2007 / 2010) or via PowerShell Code?

I've got an audit in Powershell that dumps installed applications into the comment field of a computer name.

But sometimes there is to much information to see in the comment field, and without sliders you have to EDIT the comment to VIEW the information.

Can anyone help me with this?

The powershell code looks likething like this:

#Add the comment to the call
# Set the size of the comment area to a readable size
$CurrentSheet.Cells.Item($EventRow+1,$EventCol+3).Comment.Shape.Width = 50 * 15
$CurrentSheet.Cells.Item($EventRow+1,$EventCol+3).Comment.Shape.Hieght = 30 * 15

  • 2
  • 2
1 Solution
Rory ArchibaldCommented:
You can't do that - what you can do is set the Autosize property of the Shape.Textframe to True so that it autofits the text?
gerhardubAuthor Commented:
So what would that look like in code?

$CurrentSheet.Cells.Item($EventRow+1,$EventCol+3).Comment.Autosize = $True?

Rory ArchibaldCommented:
I don't use Powershell but I would guess:
$CurrentSheet.Cells.Item($EventRow+1,$EventCol+3).Comment.Shape.Textframe.Autosize = $True
gerhardubAuthor Commented:
Worked like a champ!

(It'd still e mice if you could limit the window and have scroll bars... but it works great.)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

We Need Your Input!

WatchGuard is currently running a beta program for our new macOS Host Sensor for our Threat Detection and Response service. We're looking for more macOS users to help provide insight and feedback to help us make the product even better. Please sign up for our beta program today!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now