Hi everyone, this is first post in this forum....
any way I have Database in access 2010 and linked file with excel and I have code for open excel file from button on form..
-------------------Start CODE-------------------------
-------------------End CODE-------------------------
my problem is..
I need protect file excel " any gays don't have open without access form with click button"
I'm Protect excel file with password but I don't know how open this from access vba without requested the password
sorry for any word incorrect my English is beginner.
Thanks....
any way I have Database in access 2010 and linked file with excel and I have code for open excel file from button on form..
-------------------Start CODE-------------------------
Code:
Private Sub Command33_Click()
' Late Binding (Needs no reference set)
Dim oXL As Object
Dim oExcel As Object
Dim sFullPath As String
Dim sPath As String
' Create a new Excel instance
Set oXL = CreateObject("Excel.Application")
' Full path of excel file to open
On Error GoTo ErrHandle
sFullPath = CurrentProject.Path & "\DataBaseExcelLink.xls"
' Open it
With oXL
.Visible = True
.Workbooks.Open (sFullPath)
End With
ErrExit:
Set oXL = Nothing
Exit Sub
ErrHandle:
oXL.Visible = False
MsgBox Err.Description
GoTo ErrExit
End Sub
my problem is..
I need protect file excel " any gays don't have open without access form with click button"
I'm Protect excel file with password but I don't know how open this from access vba without requested the password
sorry for any word incorrect my English is beginner.
Thanks....