Import file *.jpg or *.bmp

Using (or providing) components based on the "Win32" framework
Post Reply
Tranber44
Posts: 36
Joined: Mon Jan 11, 2010 4:46 pm

Import file *.jpg or *.bmp

Post by Tranber44 »

Hello,

I would like to integrate images in *.bmp or *.jpg format, by an APL program, in an Excel sheet, from external files.
The codification
ActiveSheet.Pictures.Insert('D:Ges/FicBas/Sign.bmp')
returns VALUE ERROR. I use ⎕WX 1.Is there a solution?

Regards

Bertrand Delassus
Vince|Dyalog
Posts: 439
Joined: Wed Oct 01, 2008 9:39 am

Re: Import file *.jpg or *.bmp

Post by Vince|Dyalog »

Hi Bertrand,

I think the Pictures.Insert method does not exist in OLE and will only work with .NET. Are you using .NET? If so, can you post the code that you have to create ActiveSheet please?

For OLE, Dan had written an answer for this previously (https://forums.dyalog.com/viewtopic.php?f=30&t=1095#p4415), and it is this:

      xl.ActiveSheet.Shapes.AddPicture 'C:\Program Files\Dyalog\Dyalog APL-64 17.0 Unicode\ws\bubbles.bmp' 0 1 0 0 100 100


Regards,

Vince
Tranber44
Posts: 36
Joined: Mon Jan 11, 2010 4:46 pm

Re: Import file *.jpg or *.bmp

Post by Tranber44 »

Hi Vince,

Thank you for that information. Dan’s solution works perfectly and addresses all my problems.

Regards

Bertrand
Post Reply