Userform Password protected sheet sending error

PEIJudes

New Member
Joined
Feb 15, 2019
Messages
1
Hello,

I am new to this forum along with being new to Userforms and codes.

I have set up an Excel Userform, with 3 tabs at bottom of workbook. Mgmnt Ticket, Ticket Data Entry, and LookUpLists

1) Mgmnt Ticket - Password Protected but can not get the code to get through the password. If I remove the password,
then the Userform works fine. If I add the password back, I receive and error code (I have replaced the 3 locations
below that show "password" with my password that I use.
2) Ticket Data Entry tab: I have a command button to open the User Form. Works great!
3) LookUpLists tab: Password Protected Sheet - I do not want anyone to have access to it. Seems to be fine.

I need a userform that can take the data and place in my protected worksheet or into another work book.

I am stuck. Hoping someone may be able to help me.

'copy the data to the database
'use protect and unprotect lines,
' with your password "password"
' if worksheet is protected
With ws
' .Unprotect Password:="password"
.Cells(lRow, 1).Value = Me.cboDate.Value <<< ERROR MESSAGE ON THIS LINE
.Cells(lRow, 2).Value = Me.txtTime.Value
.Cells(lRow, 3).Value = Me.cboAMPM.Value
.Cells(lRow, 4).Value = Me.txtName.Value
.Cells(lRow, 3).Value = Me.cboSystem.Value
.Cells(lRow, 5).Value = Me.txtDescription.Value
' .Protect Password:="password"
End With


'clear the data
Me.cboDate.Value = ""
Me.txtTime.Value = ""
Me.cboAMPM.Value = ""
Me.txtName.Value = ""
Me.cboSystem.Value = ""
Me.txtDescription.Value = ""
Me.cboDate.SetFocus


End Sub

Help!

Judes
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
What is the error message you are getting?
 
Upvote 0

Forum statistics

Threads
1,214,559
Messages
6,120,194
Members
448,951
Latest member
jennlynn

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top