Solved

Powershell and Excel Comments: Formating Question about Excel Comments

Posted on 2010-09-16
4
1,077 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Previously, on our Nano Server Deployment series, we've created a new nano server image and deployed it on a physical server in part 2. Now we will go through configuration.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

623 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