PC Review


Reply
Thread Tools Rate Thread

Control the size of a Comment Box in Excel 2007 from Access 2007

 
 
Bill Sturdevant
Guest
Posts: n/a
 
      15th Jul 2009
In Access 2007, I create an Excel 2007 spreadsheet. I am successfully able
to add comments to cells with this code:
xlsheet.Cells(J, I + 1).Interior.ColorIndex = 4
xlsheet.Cells(J, I + 1).AddComment "Blah blah blah."
xlsheet.Cells(J, I + 1).Comment.Visible = False

I am successfully able to control the font properties of those comments with
this code:
For Each x In xlsheet.Comments
With x.Shape.TextFrame.Characters.Font
.Name = "Calibri"
.Size = 8
.Bold = False
End With
Next x

But, how do I control the SIZE of the comment boxes?
I have tried this code:
xlsheet.Cells(J, I + 1).Select
Selection.ShapeRange.ScaleHeight 2, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleWidth 2, msoFalse, msoScaleFromTopLeft

But, it fails with "Runtime error 438: Object doesn't support this property
or method".

I have references to Excel 12.0 and Office 12.0 in my Access ACCDB.

--
Bill
 
Reply With Quote
 
 
 
 
ryguy7272
Guest
Posts: n/a
 
      15th Jul 2009
Sub Comments_Size()
Dim MyComments As Comment
For Each MyComments In ActiveSheet.Comments
With MyComments
..Shape.Width = 200 'change this number to get size you want
..Shape.Height = 200 'change this number to get size you want
End With
Next ' comment
End Sub

Do you know how to control Excel from Access? If not, post back...

HTH,
Ryan---
--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Bill Sturdevant" wrote:

> In Access 2007, I create an Excel 2007 spreadsheet. I am successfully able
> to add comments to cells with this code:
> xlsheet.Cells(J, I + 1).Interior.ColorIndex = 4
> xlsheet.Cells(J, I + 1).AddComment "Blah blah blah."
> xlsheet.Cells(J, I + 1).Comment.Visible = False
>
> I am successfully able to control the font properties of those comments with
> this code:
> For Each x In xlsheet.Comments
> With x.Shape.TextFrame.Characters.Font
> .Name = "Calibri"
> .Size = 8
> .Bold = False
> End With
> Next x
>
> But, how do I control the SIZE of the comment boxes?
> I have tried this code:
> xlsheet.Cells(J, I + 1).Select
> Selection.ShapeRange.ScaleHeight 2, msoFalse, msoScaleFromTopLeft
> Selection.ShapeRange.ScaleWidth 2, msoFalse, msoScaleFromTopLeft
>
> But, it fails with "Runtime error 438: Object doesn't support this property
> or method".
>
> I have references to Excel 12.0 and Office 12.0 in my Access ACCDB.
>
> --
> Bill

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to change default font size in Word 2007 comment boxes ewn Microsoft Word Document Management 2 8th Sep 2009 01:20 PM
how do i control bubble size for each data series in excel 2007? Dave Microsoft Excel Charting 2 24th Jul 2008 12:53 PM
Access 2007 - Split Form Size Control Rob Microsoft Access Forms 0 20th Jul 2008 03:12 PM
what is the ppt comment field limitation size in powerpoint 2007 Lori Microsoft Powerpoint 1 18th Dec 2007 04:11 PM
How to use Outlook View Control 2007 in Access 2007?? =?Utf-8?B?SnVhbnF5Zg==?= Microsoft Access ADP SQL Server 0 28th Mar 2007 01:03 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:51 AM.