Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Intercept the FileOpen event in Excel using VBA

Status
Not open for further replies.

cmahon

Programmer
Sep 25, 2003
27
IE
Hi,

I am having a bit of trouble with intercepting the FileOpen event in Excel using VBA. We have a Document Management System in place for Word Documents whereby a user logs into the system and can open and save documents into a central location, without having to use the File System. I am currently trying to replicate this in Excel.

In Word I have a FileOpen sub in my macro that prompts the user to log into the document system and then presents them with a user file open form, this all works fine in Word but I cannot seem to get it to Work in Excel and I was wondering if anyone can point out what I'm doing wrong. I am aware that there are quite a few differences between Word and Excel VBA but surely the FileOpen() Sub should work in both?

Am I missing something or is the Word FileOpen called something different in Excel? The code I have in Word is


Sub FileOpen()

'
' FileOpen Macro
' Opens an existing document or template
'
Dim wd As Dialog
Dim vFileName As String
Dim vACDocRef As String
Call Initialise_oApp
On Error Resume Next
IsAuthor = False
IsAuthor = GWGetAuthorAttribute("IsAuthor")
If IsAuthor Then
vFileName = GWOpenDocument("")
Else
vFileName = "ApplicationDialog"
End If
If vFileName = "ApplicationDialog" Then
'Use File System

etc etc etc

Thanks in advance

cmahon
 
I think I've solved this now, it seems it's not as simple as intercepting the events, you need to re-assign the buttons to your macros.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top