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 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