Excel Template modification using automation

  • Thread starter Thread starter Terry Holland
  • Start date Start date
T

Terry Holland

I am using automation (from vb6 project) to open an excel template
(test.xlt). I want to modify some cell values and then resave the template.
I keep encountering a File Readonly error. Could someone post some sample
code that would allow me to programmatically modify an excel template and
then save template, overwriting old template


tai

Terry Holland
 
I think you may get various responses based on why the file was marked readonly.

If it was on a server that the user (you) only had read access, too, I think
you're out of luck.

If it was marked Readonly (via windows explorer's properties), then you could
use SetAttr (look at VBA's help) to change it.

If it was opened readonly (a parm passed in workbooks.open), then don't use that
parm.
 
Back
Top