Link to home
Start Free TrialLog in
Avatar of gerhardub
gerhardub

asked on

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
$CurrentSheet.Cells.Item($EventRow+1,$EventCol+3).Addcomment($SrvAppErrors.message)
# 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

GB
Avatar of Rory Archibald
Rory Archibald
Flag of United Kingdom of Great Britain and Northern Ireland image

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?
Avatar of gerhardub
gerhardub

ASKER

So what would that look like in code?

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


ASKER CERTIFIED SOLUTION
Avatar of Rory Archibald
Rory Archibald
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Worked like a champ!

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