Home » questions » How to increase width and height of image in custom toolbar of Excel 2000?

How to increase width and height of image in custom toolbar of Excel 2000?

2006-08-06 23:54:02, Category: Programming & Design
I designed a custom toolbar and image of msocontrolbutton is coming using .PasteFace method. Size of image is very very small in toolbar. How to increase size and brightness of image in custom toolbar of Excel 2000? Set cbImage = cbImgBar.Controls.Add(Type:=msoControlButton) With cbImage '.FaceId = 198 .Caption = "TheMarketsImage" .Style = msoButtonIcon .Width = 120 .Height = 100 .PasteFace End With Anybody can help me? I am working on automation of excel sheet and have designed a custom toolbar using VBA for Excel 2000 (or later version). When runtime i read path of image and display in custom toolbar of excel 2000 then size of image appears very small in fact it is 16X16 as per excel policy. This image is a company logo so i can not reduce size of it and have to display little bit larger i.e. 30X90. Can you help me with VBA code? I have to do this setup with help of VBA code only. My code: Dim cbImgBar As CommandBar Set cbImgBar = CommandBars.Add(Name:=cImgCommandBarID, Position:=msoBarTop) Dim cbImage As CommandBarControl Dim imgTool As Shape Dim sFileName, ImgSheet sFileName = ActiveWorkbook.Path & "\Images\ABC.jpg" ' hide appearance of picture from the user Application.ScreenUpdating = False ' insert picture from file and copy inserted picture ActiveSheet.Pictures.Insert(sFileName).CopyPicture Appearance:=xlScreen, Format:= xlBitmap Set cbImage = cbImgBar.Controls.Add(Type:=msoControlButton) With cbImage .Caption = "" .Style = msoButtonIcon .Width = 120 .Height = 1 .PasteFace End With ' remove the inserted picture ActiveSheet.Pictures(ActiveSheet.Pictures.Count).Delete Application.ScreenUpdating = True

Answers

  1. Shakeel

    On 2006-08-08 03:30:35


    You can simply edit the image in any image editor like photoshop, photopaint etc. then use that image, where you want. in excel you can choose large icons from cutomize option screen.