Open an excel sheet after clicking a pushbutton in GUI
Mostrar comentarios más antiguos
I would like to create a GUI so whenever I click the push-button (I called it OK), matlab creates an excel sheet based on an already prepared excel template. Thank you for your help.
% --- Executes on button press in OK_.
function OK__Callback(hObject, eventdata, handles)
% hObject handle to OK_ (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
Respuesta aceptada
Más respuestas (2)
Walter Roberson
el 14 de Jun. de 2016
1 voto
Fetch the template, get() any necessary properties from the uicontrols and use the values to update the copy of the template, then xlswrite() the appropriate file.
2 comentarios
Michel
el 14 de Jun. de 2016
Walter Roberson
el 15 de Jun. de 2016
I'm afraid I need a more explicit question. thanks
Image Analyst
el 15 de Jun. de 2016
Use copyfile():
copyfile(existingXLTemplateFileName, newWorkbookFileName);
If you then want to open it up in Excel, and you have Windows, do this:
winopen(newWorkbookFileName);
Categorías
Más información sobre Spreadsheets en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!