View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Barb Reinhardt Barb Reinhardt is offline
external usenet poster
 
Posts: 3,355
Default Enable macro message on VBA Workbook Open then macro ends

I have checked the Application.AutomationSecurity and have found this. The
numbers listed are the AutomationSecurity value on Debug.print. It appears
that the initial security is SecuritybyUI. I'm not sure if that's the way
it's supposed to be. Can someone confirm?

Initial Security (when Excel is opened) 2 SecuritybyUI
2
SecurityForceDisable 3
SecurityLow 1

Thanks,
Barb Reinhardt


--
HTH,
Barb Reinhardt



"Barb Reinhardt" wrote:

I posted this in another thread, but I'm going to post a larger snippet of
code. Maybe someone can help.

oldPath = File.Path
If Not oldPath Like "Z:*" Then
newPath = "http://myFolder/" & _
Right(oldPath, Len(oldPath) - 3)
newPath = Replace(oldPath, "\", "/")
End If
Debug.Print newPath

'Opens workbook

On Error Resume Next
Set oWB = Nothing
Debug.Print File.Name
Set oWB = XLApp.Workbooks(File.Name)
On Error GoTo 0

If oWB Is Nothing Then
Set oWB = XLApp.Workbooks.Open(newPath, UpdateLinks:=False,
ReadOnly:=True)
'Opens workbook, displays enable macro message, macro ends
End If

I have found that there is an issue with Workbook Open if the shift key is
pressed, so that may explain some unexplained problems with macros stopping
while I'm using communicator. I've played with
application.AutomationSecurity to no avail.

Has anyone seen this problem and identified a solution? I run macros like
this all the time and I'm dead in the water if I can't get it working again.

I'm using Office 2003, but Office 2007 is beginning to be deployed
throughout the company.

Thanks,
Barb Reinhardt