Se puede?
- Code: Select all Expand view
oSheet:Pictures:Insert("RECURSO") //Sólo permite con imágenes en disco
oSheet:Pictures:Insert("RECURSO") //Sólo permite con imágenes en disco
FW_SaveImage( "LOGO", ViaFiles+"logo.png" )
cLogo:=ViaFiles+"Logo.png"
oSheet:Range( "R1:R1" ):Select()
oSheet:Pictures:Insert(cLogo)
You can insert a Bitmap into an Excel sheet via ActiveX by using the InsertPicture method of the Range object.
This method takes two parameters: the path to the Bitmap file and an optional parameter for the PictureType.
For example:
Range("A1").InsertPicture "C:\MyBitmap.bmp", xlBitmap
You can insert a Bitmap into a Cell of an Excel sheet via ActiveX by using the InsertPicture method of the Range object. The syntax for this method is:
Range.InsertPicture(Filename, LinkToFile, SaveWithDocument, Left, Top, Width, Height, Anchor).
The Filename parameter is the path to the Bitmap file you want to insert.
The LinkToFile parameter is a Boolean value that determines whether the Bitmap is linked to the file or not.
The SaveWithDocument parameter is a Boolean value that determines whether the Bitmap is saved with the document or not.
The Left, Top, Width, and Height parameters are the coordinates and size of the Bitmap.
The Anchor parameter is an object that determines where the Bitmap is anchored in the cell.
Graphic Object (Excel)
Contains properties that apply to header and footer picture objects.
Collapse sectionRemarks
There are several properties of the PageSetup object that return the Graphic object.
Use the CenterFooterPicture , CenterHeaderPicture , LeftFooterPicture , LeftHeaderPicture , RightFooterPicture , or RightHeaderPicture properties to return a Graphic object.
NoteNote
It is required that "&G" is a part of the LeftFooter string in order for the image to show up in the left footer.
Collapse sectionExample
The following example adds a picture titled: Sample.jpg from the C:\ drive to the left section of the footer. This example assumes that a file called Sample.jpg exists on the C:\ drive.
- Code: Select all Expand view
VBA Copy codeCopy code
Sub InsertPicture()
With ActiveSheet.PageSetup.LeftFooterPicture
.FileName = "C:\Sample.jpg"
.Height = 275.25
.Width = 463.5
.Brightness = 0.36
.ColorType = msoPictureGrayscale
.Contrast = 0.39
.CropBottom = -14.4
.CropLeft = -28.8
.CropRight = -14.4
.CropTop = 21.6
End With
' Enable the image to show up in the left footer.
ActiveSheet.PageSetup.LeftFooter = "&G"
End Sub
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 34 guests