Problems with lines using Save() function during Excel processing in Matlab

Invoke Error, Dispatch Exception:
Source: Microsoft Excel
Description: Save method of Workbook class failed
Help File: xlmain11.chm
Help Context ID: 0
---------------------------------------------------
excelApp = actxserver('Excel.Application');
excelApp.DisplayAlerts = false;
excelApp.Visible = false;
workbook = excelApp.Workbooks.Open(fullfileName);
sheet = workbook.Sheets.Item(sheetNum);
shapes = sheet.Shapes;
shape = shapes.AddOLEObject([], pdfPath, 0,1,[],[],[],left,top,1,1);
workbook.Save; % error occurred this line
workbook.Close(false);
excelApp.Quit;
delete(excelApp);
What's the problem?
I would appreciate it if you could let me know the number of all possible cases.
First of all, I don't think I took the wrong route..
I experimented with 4 to 5 PCs with the same code
On some PCs, the code runs well,
Another PC spits out such an error, so I wonder if this is an environmental problem.

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Data Import from MATLAB 的更多信息

产品

版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by