export to excel template

S

SMT

Forgive me if this is a duplicate post. I couldnt not find my original but
sometimes when I login from work pc I experience issues that I dont have on
home pc.

I have a button on my access form that exports a query to an excel template
and then opens up the template file. The problems is using the followhypelink
opens up the template file and allows the user to save back over it. I just
want to use the template as a shell for the data to export out to and dont
want the user to be able to save over the template file. If i export and dont
use the followhyperlink button but go to the xlt file and open via mycomputer
or within excel it will open the xlt file with and diferent name so the file
will not be overwritten is there anything I can do differently in the code
below that would open up the newly generated file but not allow the user to
save back over the xlt file. THanks in advance.

DoCmd.TransferSpreadsheet acExport, _
acSpreadsheetTypeExcel9, "qryGraphExportStep4Dept", _
"c:qryGraphExportStep4.xlt", , "qryGraphExportStep4"
Application.FollowHyperlink "c:qryGraphExportStep4.xlt"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top