Export image(figure) in excel to JPG file

2 vues (au cours des 30 derniers jours)
JongChun
JongChun le 7 Déc 2018
Commenté : Image Analyst le 8 Déc 2018
Hello, all. I have a simple question.
In my xls file, some contents(from A1 to C27) is captured as image(from E1 to G27) using Camera tool in excel.
I want to export this image(from E1 to G27) as JPG file using Matlab command.
I've tried to that through
actxserver('excel.application');
.Sheets.Item(1).Chart(1);
.Chart.Export(File name);
But, it doesn't work because image file by Camera tool is not recognized as chart but simple image.
So, I think I try to another command such as ExportAsFixedFormat or export range into image file so on.. But it doesn't work well.
Is somebody can give me a hint?
Cheers,

Réponses (1)

Image Analyst
Image Analyst le 7 Déc 2018
Did you record a macro and look at the VBA source code to see what it does?
  2 commentaires
JongChun
JongChun le 8 Déc 2018
Sub Macro1()
Range("B1:AN38").Select
Selection.Copy
ActiveSheet.Shapes.AddShape(, 1114.5, 3.75, 756.75, 756.75).Select
ActiveSheet.Shapes.Range(Array("Picture 5")).Select
Application.CutCopyMode = False
End Sub
But, I am wondering how those VBA code can be converted to Matlab command?
for example, I cannot make commaned as like "Selection.Copy" in VBA.
Image Analyst
Image Analyst le 8 Déc 2018
See attached example where I use some ActiveX commands from MATLAB to control Excel.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Use COM Objects in MATLAB dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by