Solved

Powershell and Excel Comments: Formating Question about Excel Comments

Posted on 2010-09-16
4
1,026 Views
Last Modified: 2012-05-10
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
0
Comment
Question by:gerhardub
  • 2
  • 2
4 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 33693308
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?
0
 
LVL 1

Author Comment

by:gerhardub
ID: 33694605
So what would that look like in code?

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


0
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 500 total points
ID: 33695040
I don't use Powershell but I would guess:
$CurrentSheet.Cells.Item($EventRow+1,$EventCol+3).Comment.Shape.Textframe.Autosize = $True
0
 
LVL 1

Author Closing Comment

by:gerhardub
ID: 33697949
Worked like a champ!

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

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Join & Write a Comment

Utilizing an array to gracefully append to a list of EmailAddresses
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now