Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert Picture to Excel to specified range
i want to insert picture from disk to excel using visual basic 6. i've use
following code: dim oApp As New Excel.Application dim oWkbk As Excel.Workbook dim oSheet As Excel.Worksheet ActiveCell.Range("A100").Activate ActiveSheet.Pictures.Insert ("C:\TEMP.BMP") the problem is, the picture is to large and i want to insert that picture only from cell A100 to E120. which function i should use? any help would be greatly appreciate.. thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert Picture to Excel to specified range
Sub Linked() Dim s As Shape With [b5] Set s = .Parent.Shapes.AddPicture("D:\Documents\!Pictures\ marg_v1.png", True, True, .Left, .Top, .Width, .Height) End With With s .ScaleHeight 0.5, msoTrue .ScaleWidth 0.5, msoTrue End With End Sub demo shows insertion with cell's size then scales to 50% of original (saved) size look in VBA help for meaning of arguments. cheerz! keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Budiono" wrote: i want to insert picture from disk to excel using visual basic 6. i've use following code: dim oApp As New Excel.Application dim oWkbk As Excel.Workbook dim oSheet As Excel.Worksheet ActiveCell.Range("A100").Activate ActiveSheet.Pictures.Insert ("C:\TEMP.BMP") the problem is, the picture is to large and i want to insert that picture only from cell A100 to E120. which function i should use? any help would be greatly appreciate.. thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert Picture to Excel to specified range
i've try ur code but it doesn't work :(
what do you mean with '[b5]' ? "keepitcool" wrote in message ... Sub Linked() Dim s As Shape With [b5] Set s = .Parent.Shapes.AddPicture("D:\Documents\!Pictures\ marg_v1.png", True, True, .Left, .Top, .Width, .Height) End With With s .ScaleHeight 0.5, msoTrue .ScaleWidth 0.5, msoTrue End With End Sub demo shows insertion with cell's size then scales to 50% of original (saved) size look in VBA help for meaning of arguments. cheerz! keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Budiono" wrote: i want to insert picture from disk to excel using visual basic 6. i've use following code: dim oApp As New Excel.Application dim oWkbk As Excel.Workbook dim oSheet As Excel.Worksheet ActiveCell.Range("A100").Activate ActiveSheet.Pictures.Insert ("C:\TEMP.BMP") the problem is, the picture is to large and i want to insert that picture only from cell A100 to E120. which function i should use? any help would be greatly appreciate.. thanks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert Picture to Excel to specified range
[b5] is short code for range("b5") on the activesheet
[sheet3!b5)=worksheets("sheet3").range("b5") it probably doesnt work due to linebreaks or file not found. for me the principle works in xl97 & xlxp adjusted it would look like: Sub Linked() Dim s As Shape With [a100] Set s = .Parent.Shapes.AddPicture( _ "C:\TEMP.BMP", _ True, True, .Left, .Top, .Width, .Height) End With With s .ScaleHeight 0.5, msoTrue .ScaleWidth 0.5, msoTrue End With End Sub keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Budiono" wrote: i've try ur code but it doesn't work :( what do you mean with '[b5]' ? "keepitcool" wrote in message ... Sub Linked() Dim s As Shape With [b5] Set s = .Parent.Shapes.AddPicture("D:\Documents\!Pictures \marg_v1.png", True, True, .Left, .Top, .Width, .Height) End With With s .ScaleHeight 0.5, msoTrue .ScaleWidth 0.5, msoTrue End With End Sub demo shows insertion with cell's size then scales to 50% of original (saved) size look in VBA help for meaning of arguments. cheerz! keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Budiono" wrote: i want to insert picture from disk to excel using visual basic 6. i've use following code: dim oApp As New Excel.Application dim oWkbk As Excel.Workbook dim oSheet As Excel.Worksheet ActiveCell.Range("A100").Activate ActiveSheet.Pictures.Insert ("C:\TEMP.BMP") the problem is, the picture is to large and i want to insert that picture only from cell A100 to E120. which function i should use? any help would be greatly appreciate.. thanks |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert Picture to Excel to specified range
thanks for your replay, but i still have diffilculties.
do you mean that sub procedure as a macro that i've to save it to .bas file? i've save it to .bas file and then do the following code: oWkbk.VBE.ActiveVBProject.VBComponents.Import "C:\picsize.bas" 'i've save your code to file picsize.bas oWkbk.Run "picsize", oSheet but it doesn't work :( where i can file for VBA help files? thanks :) "keepitcool" wrote in message ... [b5] is short code for range("b5") on the activesheet [sheet3!b5)=worksheets("sheet3").range("b5") it probably doesnt work due to linebreaks or file not found. for me the principle works in xl97 & xlxp adjusted it would look like: Sub Linked() Dim s As Shape With [a100] Set s = .Parent.Shapes.AddPicture( _ "C:\TEMP.BMP", _ True, True, .Left, .Top, .Width, .Height) End With With s .ScaleHeight 0.5, msoTrue .ScaleWidth 0.5, msoTrue End With End Sub |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert Picture to Excel to specified range
i've tried again n it's work. thanks :)
"keepitcool" wrote in message ... [b5] is short code for range("b5") on the activesheet [sheet3!b5)=worksheets("sheet3").range("b5") it probably doesnt work due to linebreaks or file not found. for me the principle works in xl97 & xlxp adjusted it would look like: Sub Linked() Dim s As Shape With [a100] Set s = .Parent.Shapes.AddPicture( _ "C:\TEMP.BMP", _ True, True, .Left, .Top, .Width, .Height) End With With s .ScaleHeight 0.5, msoTrue .ScaleWidth 0.5, msoTrue End With End Sub keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Budiono" wrote: i've try ur code but it doesn't work :( what do you mean with '[b5]' ? "keepitcool" wrote in message ... Sub Linked() Dim s As Shape With [b5] Set s = .Parent.Shapes.AddPicture("D:\Documents\!Pictures \marg_v1.png", True, True, .Left, .Top, .Width, .Height) End With With s .ScaleHeight 0.5, msoTrue .ScaleWidth 0.5, msoTrue End With End Sub demo shows insertion with cell's size then scales to 50% of original (saved) size look in VBA help for meaning of arguments. cheerz! keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Budiono" wrote: i want to insert picture from disk to excel using visual basic 6. i've use following code: dim oApp As New Excel.Application dim oWkbk As Excel.Workbook dim oSheet As Excel.Worksheet ActiveCell.Range("A100").Activate ActiveSheet.Pictures.Insert ("C:\TEMP.BMP") the problem is, the picture is to large and i want to insert that picture only from cell A100 to E120. which function i should use? any help would be greatly appreciate.. thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do I insert picture into cell so vlookup can return picture? | Excel Worksheet Functions | |||
insert a picture in to a comment but picture not save on hard disk | Excel Discussion (Misc queries) | |||
insert picture to a specfic range of cells | Excel Discussion (Misc queries) | |||
How do I put a picture in excel with out using insert? | Excel Discussion (Misc queries) | |||
insert picture into excel | Excel Worksheet Functions |