ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save data without code... (https://www.excelbanter.com/excel-programming/419498-save-data-without-code.html)

Juan García[_2_]

Save data without code...
 
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




joel

Save data without code...
 
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


"Juan GarcĂ*a" wrote:

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






All times are GMT +1. The time now is 05:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com