Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I insert picture into cell so vlookup can return picture? ah Excel Worksheet Functions 1 May 1st 07 04:38 AM
insert a picture in to a comment but picture not save on hard disk Pablo Excel Discussion (Misc queries) 0 February 21st 07 03:48 PM
insert picture to a specfic range of cells CORY Excel Discussion (Misc queries) 8 February 3rd 06 05:50 PM
How do I put a picture in excel with out using insert? RFCahoon Excel Discussion (Misc queries) 4 July 17th 05 03:07 AM
insert picture into excel Macca Excel Worksheet Functions 0 November 10th 04 03:44 PM


All times are GMT +1. The time now is 03:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"