Save data without code...

  • Thread starter Thread starter Juan García
  • Start date Start date
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
 
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
 
Back
Top