Reputation: 27
I'm trying to open the directory that contains my Access database using this code
Dim path As String
path = ActiveWorkbook.path & "\"
Shell "cmd /C start """" /max """ & path & """", vbHide
as suggested here by @AnorZaken.
The second line however raises a run time error "424 object required".
When I use some static path (i.e. path = "C:\"
) everything works fine.
Upvotes: 1
Views: 636
Reputation: 97101
ActiveWorkbook
is for Excel. In Access, use CurrentProject
'path = ActiveWorkbook.path & "\"
path = CurrentProject.Path & "\"
Upvotes: 2