H
Hari
Hi,
I have a workbook_open event, in which Im unprotecting a sheet, copy a
cell's contents (A3 Cell) in that unprotected sheet and paste it in to cell
J12 of the same sheet and then protecting back the sheet.
Idea seeking - Im quite wary of my VB project password being "hacked" in to.
Plainly speaking I dont have much problem if they see the code etc but in
the workbook_open event the password of the sheet is given which I would not
like to disclose. Its because I use the same password for protecting other
sheets and the workbook itself. I understand that worksheet passwords can be
easily hacked but after hacking I believe the hacker can only unprotect the
sheet and will not know what password I have kept. ( that is im fine if the
hacker hacks the sheet but as a result of hacking I dont want the actual
password to be known).
Doubt - Hence, I thought that since Im performing a fairly simple operation
of copy paste in that sheet, why not unprotect those 2 cells ( A3 and J12 )
and this way when the code runs I would not have to supply the password of
the worksheet in the code. Now, while doing this operation I want the cells
J12 to P13 to be merged and the resultant cell J12 to have a date format.
Presently my code is :-
Private Sub Workbook_Open() 'line no 1
Sheets("Report Data").Unprotect Password:="g" 'line no 2
Sheets("Report Data").Cells(12, 10) = Sheets("Report Data").Cells(3, 1)
'line no 3
Sheets("Report Data").Cells(3, 1) = "" 'line no 4
Sheets("Report Data").Protect Password:="g", 'line no 5
End sub()
Since I will be doing away with line no 2 and line no 5, I want to put a
code just before the present line no 3 which merges cell J12 to cell p13 and
also formats the resultant cell J12 to date format.
Please guide me.
Regards,
Hari
India
I have a workbook_open event, in which Im unprotecting a sheet, copy a
cell's contents (A3 Cell) in that unprotected sheet and paste it in to cell
J12 of the same sheet and then protecting back the sheet.
Idea seeking - Im quite wary of my VB project password being "hacked" in to.
Plainly speaking I dont have much problem if they see the code etc but in
the workbook_open event the password of the sheet is given which I would not
like to disclose. Its because I use the same password for protecting other
sheets and the workbook itself. I understand that worksheet passwords can be
easily hacked but after hacking I believe the hacker can only unprotect the
sheet and will not know what password I have kept. ( that is im fine if the
hacker hacks the sheet but as a result of hacking I dont want the actual
password to be known).
Doubt - Hence, I thought that since Im performing a fairly simple operation
of copy paste in that sheet, why not unprotect those 2 cells ( A3 and J12 )
and this way when the code runs I would not have to supply the password of
the worksheet in the code. Now, while doing this operation I want the cells
J12 to P13 to be merged and the resultant cell J12 to have a date format.
Presently my code is :-
Private Sub Workbook_Open() 'line no 1
Sheets("Report Data").Unprotect Password:="g" 'line no 2
Sheets("Report Data").Cells(12, 10) = Sheets("Report Data").Cells(3, 1)
'line no 3
Sheets("Report Data").Cells(3, 1) = "" 'line no 4
Sheets("Report Data").Protect Password:="g", 'line no 5
End sub()
Since I will be doing away with line no 2 and line no 5, I want to put a
code just before the present line no 3 which merges cell J12 to cell p13 and
also formats the resultant cell J12 to date format.
Please guide me.
Regards,
Hari
India