Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Powershell and Excel Comments: Formating Question about Excel Comments

Posted on 2010-09-16
4
Medium Priority
?
1,099 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 2000 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

 The Evil-ution of Network Security Threats

What are the hacks that forever changed the security industry? To answer that question, we created an exciting new eBook that takes you on a trip through hacking history. It explores the top hacks from the 80s to 2010s, why they mattered, and how the security industry responded.

Question has a verified solution.

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

If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

783 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