I have write a code to create a Excel sheet where i’m printing some calculated table values. It is working fine. This file will be stored in the current system specified folder - this is also done by coding.
my questions are listed below
how to save the file as write protected (as a read only file)
how to give the background color for headings (coloring the cells)
If anyone knows about this, Please help me to resolve the issue.
Do you use this method to save your worksheet: sysExcelWorkbook.saveAs() ? If so, have you tried setting the fourth parameter (_readOnlyRecommended) to TRUE? I wonder if that could do the job.
Otherwise , straight after the saving your worksheet, you could call WinApi::setFileAttributes() method and set the attribute of the newly created file to read-only.