My VBA isn't recognizing this function, what am I missing? Is there a reference I need to add? I'm trying to open a file when I click on a button (different file types).
My VBA isn't recognizing this function, what am I missing? Is there a reference I need to add? I'm trying to open a file when I click on a button (different file types).
Try setting reference to Microsoft Shell Controls and Automation.
Need to show code or provide project so we can analyze.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Thanks for replying. I tried that, didn't solve it, still got a compile error.
On further research I found that I was missing the following declaration in the code (for anyone who wants it in future):
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long