Save data without code...

J

Juan García

I have a workbook with a lot of code in modules and userforms. This code is
protected with password but I would like the user can´t save it with the
data. Is there an option to save only the data in the sheet without the
code.
Thanks
 
J

Joel

You have to create a new workbook and copy the worksheets.

First = True
for each sht in thisworkbook.sheets
if First = True then
'copy sheet to create new workbook
sht.Copy
set newbk = activeworkbook
First = False
else
sht.copy after:=newbk.sheets(newbk.sheets.count)
end if
next sht
newbk.saveas filename = ABC.XLS
newbk.close


next
 

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