ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   insert image (https://www.excelbanter.com/excel-programming/367074-insert-image.html)

vj5

insert image
 
hi experts,
how to insert image from resource file.

Norman Jones

insert image
 
Hi VJ,

Try something like:

'=============
Public Sub Tester()
Dim myPath As String
Dim MyImage As String

my Path = "C:\Documents and Settings\VJS\" _
& "My Documents\My
Pictures\"
MyImage = "YourImage Name.jpg"

ActiveSheet.Pictures.Insert (myPath & MyImage)

End Sub
'<<=============


---
Regards,
Norman


"vj5" wrote in message
...
hi experts,
how to insert image from resource file.




NickHK

insert image
 
Whilst you can certainly use the API to LoadLibrary/LoadBitmap etc in VBA,
none of Excel's objects (natively) expose handles or DCs, so I can't see
what you would do with results.
Save the pic to file, insert, then delete ?

NickHK

"vj5" wrote in message
...
hi experts,
how to insert image from resource file.




vj5

insert image
 
hi experts
thanks for reply
my problem is that i can't save image in a file and can't give path of
image file.
i have to take image from resource file only.
is there ANY possibility to do the same?



"Norman Jones" wrote:

Hi VJ,

Try something like:

'=============
Public Sub Tester()
Dim myPath As String
Dim MyImage As String

my Path = "C:\Documents and Settings\VJS\" _
& "My Documents\My
Pictures\"
MyImage = "YourImage Name.jpg"

ActiveSheet.Pictures.Insert (myPath & MyImage)

End Sub
'<<=============


---
Regards,
Norman


"vj5" wrote in message
...
hi experts,
how to insert image from resource file.





vj5

insert image
 
thanks for reply
my problem is that i can't save image in a file and can't give path of
image file.
i have to take image from resource file only.
is there ANY possibility to do the same?


"NickHK" wrote:

Whilst you can certainly use the API to LoadLibrary/LoadBitmap etc in VBA,
none of Excel's objects (natively) expose handles or DCs, so I can't see
what you would do with results.
Save the pic to file, insert, then delete ?

NickHK

"vj5" wrote in message
...
hi experts,
how to insert image from resource file.





NickHK

insert image
 
Take it from the resource file, save to file, insert, delete the file.

Why can't you save to file temporarily ?

NickHK

"vj5" wrote in message
...
thanks for reply
my problem is that i can't save image in a file and can't give path of
image file.
i have to take image from resource file only.
is there ANY possibility to do the same?


"NickHK" wrote:

Whilst you can certainly use the API to LoadLibrary/LoadBitmap etc in

VBA,
none of Excel's objects (natively) expose handles or DCs, so I can't see
what you would do with results.
Save the pic to file, insert, then delete ?

NickHK

"vj5" wrote in message
...
hi experts,
how to insert image from resource file.







vj5

insert image
 
if user don't have save permission than it will fails thats why i can't
save it on machine.


"NickHK" wrote:

Take it from the resource file, save to file, insert, delete the file.

Why can't you save to file temporarily ?

NickHK

"vj5" wrote in message
...
thanks for reply
my problem is that i can't save image in a file and can't give path of
image file.
i have to take image from resource file only.
is there ANY possibility to do the same?


"NickHK" wrote:

Whilst you can certainly use the API to LoadLibrary/LoadBitmap etc in

VBA,
none of Excel's objects (natively) expose handles or DCs, so I can't see
what you would do with results.
Save the pic to file, insert, then delete ?

NickHK

"vj5" wrote in message
...
hi experts,
how to insert image from resource file.







NickHK

insert image
 
You can always save it to
C:\Documents and Settings\<Current User\Application Data\<Your Company\
Or the Temp folder.
You must be able to save it somewhere.

NickHK

"vj5" wrote in message
...
if user don't have save permission than it will fails thats why i can't
save it on machine.


"NickHK" wrote:

Take it from the resource file, save to file, insert, delete the file.

Why can't you save to file temporarily ?

NickHK

"vj5" wrote in message
...
thanks for reply
my problem is that i can't save image in a file and can't give path of
image file.
i have to take image from resource file only.
is there ANY possibility to do the same?


"NickHK" wrote:

Whilst you can certainly use the API to LoadLibrary/LoadBitmap etc

in
VBA,
none of Excel's objects (natively) expose handles or DCs, so I can't

see
what you would do with results.
Save the pic to file, insert, then delete ?

NickHK

"vj5" wrote in message
...
hi experts,
how to insert image from resource file.









vj5

insert image
 
but i note have permission to save anything on machine


"NickHK" wrote:

You can always save it to
C:\Documents and Settings\<Current User\Application Data\<Your Company\
Or the Temp folder.
You must be able to save it somewhere.

NickHK

"vj5" wrote in message
...
if user don't have save permission than it will fails thats why i can't
save it on machine.


"NickHK" wrote:

Take it from the resource file, save to file, insert, delete the file.

Why can't you save to file temporarily ?

NickHK

"vj5" wrote in message
...
thanks for reply
my problem is that i can't save image in a file and can't give path of
image file.
i have to take image from resource file only.
is there ANY possibility to do the same?


"NickHK" wrote:

Whilst you can certainly use the API to LoadLibrary/LoadBitmap etc

in
VBA,
none of Excel's objects (natively) expose handles or DCs, so I can't

see
what you would do with results.
Save the pic to file, insert, then delete ?

NickHK

"vj5" wrote in message
...
hi experts,
how to insert image from resource file.










NickHK

insert image
 
How are the temp files created that are required for Excel to run ?
So Excel cannot save any of the changes that its users make either ?

Pretty useless system then.

NickHK

"vj5" wrote in message
...
but i note have permission to save anything on machine


"NickHK" wrote:

You can always save it to
C:\Documents and Settings\<Current User\Application Data\<Your

Company\
Or the Temp folder.
You must be able to save it somewhere.

NickHK

"vj5" wrote in message
...
if user don't have save permission than it will fails thats why i

can't
save it on machine.


"NickHK" wrote:

Take it from the resource file, save to file, insert, delete the

file.

Why can't you save to file temporarily ?

NickHK

"vj5" wrote in message
...
thanks for reply
my problem is that i can't save image in a file and can't give

path of
image file.
i have to take image from resource file only.
is there ANY possibility to do the same?


"NickHK" wrote:

Whilst you can certainly use the API to LoadLibrary/LoadBitmap

etc
in
VBA,
none of Excel's objects (natively) expose handles or DCs, so I

can't
see
what you would do with results.
Save the pic to file, insert, then delete ?

NickHK

"vj5" wrote in message
...
hi experts,
how to insert image from resource file.












vj5

insert image
 
that i don't know but i can't save file on local machine.
is there any possibility to do the same?

"NickHK" wrote:

How are the temp files created that are required for Excel to run ?
So Excel cannot save any of the changes that its users make either ?

Pretty useless system then.

NickHK

"vj5" wrote in message
...
but i note have permission to save anything on machine


"NickHK" wrote:

You can always save it to
C:\Documents and Settings\<Current User\Application Data\<Your

Company\
Or the Temp folder.
You must be able to save it somewhere.

NickHK

"vj5" wrote in message
...
if user don't have save permission than it will fails thats why i

can't
save it on machine.


"NickHK" wrote:

Take it from the resource file, save to file, insert, delete the

file.

Why can't you save to file temporarily ?

NickHK

"vj5" wrote in message
...
thanks for reply
my problem is that i can't save image in a file and can't give

path of
image file.
i have to take image from resource file only.
is there ANY possibility to do the same?


"NickHK" wrote:

Whilst you can certainly use the API to LoadLibrary/LoadBitmap

etc
in
VBA,
none of Excel's objects (natively) expose handles or DCs, so I

can't
see
what you would do with results.
Save the pic to file, insert, then delete ?

NickHK

"vj5" wrote in message
...
hi experts,
how to insert image from resource file.














All times are GMT +1. The time now is 08:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com