xlswrite1
라이선스 없음
This code increases the speed of the xlswrite function when used in loops or multiple times. The problem with the original function is that it opens and closes the Excel server every time the function is used. To increase the speed I have just edited the original function by removing the server open and close function from the xlswrite function and moved them outside of the function. To use this first run the following code which opens the activex server and checks to see if the file already exists (creates if it doesnt):
Excel = actxserver ('Excel.Application');
File='C:\YourFileFolder\FileName';
if ~exist(File,'file')
ExcelWorkbook = Excel.workbooks.Add;
ExcelWorkbook.SaveAs(File,1);
ExcelWorkbook.Close(false);
end
invoke(Excel.Workbooks,'Open',File);
Then run the new xlswrite1 function as many times as needed or in a loop (for example xlswrite1(File,data,location). Then run the following code to close the activex server:
invoke(Excel.ActiveWorkbook,'Save');
Excel.Quit
Excel.delete
clear Excel
This works exactly like the original xlswrite function, only many many times faster.
인용 양식
Matt Swartz (2024). xlswrite1 (https://www.mathworks.com/matlabcentral/fileexchange/10465-xlswrite1), MATLAB Central File Exchange. 검색 날짜: .
MATLAB 릴리스 호환 정보
플랫폼 호환성
Windows macOS Linux카테고리
- MATLAB > Data Import and Analysis > Data Import and Export > Standard File Formats > Spreadsheets >
- MATLAB > External Language Interfaces > COM with MATLAB > Use COM Objects in MATLAB >
태그
도움
도움 준 파일: wr_colwithheader, Tea Component Analysis, xlswrite_mod, saveppt2, Function for faster data transfer Matlab <--> Excel, xlswrite2007, MKXLSFUNC: Easily integrate legacy spreadsheet tools into MATLAB
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!버전 | 게시됨 | 릴리스 정보 | |
---|---|---|---|
1.0.0.0 |