フィルターのクリア

Save Excel OLE Object to disk

15 ビュー (過去 30 日間)
Afzal
Afzal 2020 年 2 月 20 日
編集済み: Afzal 2020 年 2 月 21 日
I have a spreadsheet with two jpeg files embedded in it. I would like to extract these and write them to a specific directory. I can do this in VBA as:
Sub Macro1()
ActiveSheet.Shapes.Range("Photo Object 1").Select
Selection.Copy
DestinationFolder = "C:..."
CreateObject("Shell.Application").Namespace(CVar(DestinationFolder)).self.InvokeVerb "Paste"
ActiveSheet.Shapes.Range("Photo Object 2").Select
Selection.Copy
CreateObject("Shell.Application").Namespace(CVar(DestinationFolder)).self.InvokeVerb "Paste"
End Sub
I'd like to do the same through MATLAB. So far what I've got the following:
Excel = actxserver('Excel.Application');
fullFileName = 'C:\....xls';
invoke(Excel.Workbooks, 'Open', fullFileName);
Workbook = Excel.ActiveWorkbook;
Worksheets = Workbook.sheets;
objects=Worksheets.Item(1).OLEObjects;
image1=Item(objects,1); % This is photo object 1
image2=Item(objects,2); % This is photo object 2
Copy(image1)
objShell = actxserver('Shell.Application');
DestinationFolder = 'C:\';
objFolder = objShell.NameSpace(DestinationFolder);
objFolderItem = objFolder.Self;
I can't work out how to paste the copied image from the system clipboard to a directory

回答 (0 件)

カテゴリ

Help Center および File ExchangeData Export to MATLAB についてさらに検索

製品


リリース

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by