Command Button to open a password protected excel spreadsheet

J

james

Hi
Sorry I am not experienced with VB.
Could someone please provide a code I can assign to a command button that
will open a specific excel spreadsheet that is password protected and input
the password on our behalf?

Adapting the following would be great

Private Sub Command0_Click()
On Error GoTo Err_Command0_Click

Dim oApp As Object

Set oApp = CreateObject("Excel.Application")
oApp.Visible = True
'Only XL 97 supports UserControl Property
On Error Resume Next
oApp.UserControl = True

Exit_Command0_Click:
Exit Sub

Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click

End Sub

Thanks
 

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