Cannot access read-only document 'excel_filename.xls'
Iam working on c# console. what iam trying to do is to get excel template and insert all records in in excell and create a copy to save the excel to network shared folder using a impersonated specific user..but the error was "Cannot access read-only document 'excel_filename.xls'."" please see my code snippet see error SaveAsCopy


mary jean ligasRank #3,676 · 400 reputationPosted Mar 8, 2016, 7:29 PM EST
Rajeev PunhaniRank #551 · 4.4K reputationPosted Mar 7, 2016, 6:50 PM EST
Hi Mary,
Try to save the Excel file locally and then check if you are able to access it.
mary jean ligasRank #3,676 · 400 reputationPosted Mar 7, 2016, 7:11 PM EST
Rajeev PunhaniRank #551 · 4.4K reputationPosted Mar 7, 2016, 7:15 PM EST
Hi Mary,
This issue can occur if you are saving to a network drive and you do not have sufficient privileges to save to that drive. Thus, you might not be able to access the file. File might be read-only and user is not allowed to access it. Read-only nature of a file implies that it is not allowed to access or modify a file. Please check folder permission.
mary jean ligasRank #3,676 · 400 reputationPosted Mar 7, 2016, 7:19 PM EST
mary jean ligasRank #3,676 · 400 reputationPosted Mar 8, 2016, 5:31 PM EST
Amatya AgyeyRank #1,635 · 944 reputationPosted Mar 8, 2016, 6:52 PM EST
mary jean ligasRank #3,676 · 400 reputationPosted Mar 8, 2016, 7:15 PM EST
Amatya AgyeyRank #1,635 · 944 reputationPosted Mar 8, 2016, 7:24 PM EST
Amatya AgyeyRank #1,635 · 944 reputationPosted Mar 8, 2016, 7:36 PM EST
mary jean ligasRank #3,676 · 400 reputationPosted Mar 8, 2016, 7:41 PM EST
Amatya AgyeyRank #1,635 · 944 reputationPosted Mar 8, 2016, 7:44 PM EST
mary jean ligasRank #3,676 · 400 reputationPosted Mar 8, 2016, 7:45 PM EST
Rajeev PunhaniRank #551 · 4.4K reputationPosted Mar 8, 2016, 8:15 PM EST
Hi Mary,
Please try
oMissing, oMissing, oMissing, oMissing, oMissing, oMissing,
oMissing, oMissing, oMissing, oMissing, oMissing, oMissing);
mary jean ligasRank #3,676 · 400 reputationPosted Mar 8, 2016, 8:20 PM EST