Problems with lines using Save() function during Excel processing in Matlab
Afficher commentaires plus anciens
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.
1 commentaire
Mario Malic
le 5 Mar 2024
Also, try to save a file providing a full path to the directory with read/write access and see if the Save/SaveAs method works properly.
Réponses (0)
Catégories
En savoir plus sur Spreadsheets dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!