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.

Answers (0)

Categories

Products

Release

R2023b

Asked:

on 5 Mar 2024

Commented:

on 5 Mar 2024

Community Treasure Hunt

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

Start Hunting!