Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Are the macros allowed?
Hello,
I would like to ask you which VBA property or command should I use if I want to know if the user allowed usage of macros when he was opening some Excel file. Thanks in advance, Milan. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Are the macros allowed?
If the user allowed macros to run, then you can use anything you want.
But if the user didn't allow macros to run, then any code you try to use won't be running--so it wouldn't matter. Milan wrote: Hello, I would like to ask you which VBA property or command should I use if I want to know if the user allowed usage of macros when he was opening some Excel file. Thanks in advance, Milan. -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Are the macros allowed?
Thank you. Maybe my question was not written exactly. I have developed
an application in Access which cooperates with some Excel file which has been opened by user before. I would like to know how can I find out in Access (i use the command GetObject) if the macros are enabled or disabled in the opened Excel file. Of course I know how to find it out but I wonder if there is some simple elegant way. Thanks, Milan. Dave Peterson wrote in message ... If the user allowed macros to run, then you can use anything you want. But if the user didn't allow macros to run, then any code you try to use won't be running--so it wouldn't matter. Milan wrote: Hello, I would like to ask you which VBA property or command should I use if I want to know if the user allowed usage of macros when he was opening some Excel file. Thanks in advance, Milan. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Are the macros allowed?
If you have control over that excel file, can you add a test function?
Option Explicit Function testme01() As Boolean testme01 = True End Function I don't use Access, but this seemed to return good stuff when called from MSWord: Option Explicit Sub testme() Dim xlApp As Object Dim wkbk As Object Dim macsAvailable As Boolean Set xlApp = Nothing On Error Resume Next Set xlApp = GetObject(, "excel.application") On Error GoTo 0 If xlApp Is Nothing Then MsgBox "excel isn't running!" Exit Sub End If Set wkbk = xlApp.activeworkbook On Error Resume Next macsAvailable = xlApp.Run(wkbk.Name & "!testme01") On Error GoTo 0 If macsAvailable Then MsgBox "macs are available" Else MsgBox "macs not available" End If End Sub Milan wrote: Thank you. Maybe my question was not written exactly. I have developed an application in Access which cooperates with some Excel file which has been opened by user before. I would like to know how can I find out in Access (i use the command GetObject) if the macros are enabled or disabled in the opened Excel file. Of course I know how to find it out but I wonder if there is some simple elegant way. Thanks, Milan. Dave Peterson wrote in message ... If the user allowed macros to run, then you can use anything you want. But if the user didn't allow macros to run, then any code you try to use won't be running--so it wouldn't matter. Milan wrote: Hello, I would like to ask you which VBA property or command should I use if I want to know if the user allowed usage of macros when he was opening some Excel file. Thanks in advance, Milan. -- Dave Peterson |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Are the macros allowed?
I would like to thank you for your answers!
Milan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
allowed/taken | Excel Worksheet Functions | |||
allowed / taken | Excel Worksheet Functions | |||
What does No More Fonts Allowed in Workbook mean? | Excel Discussion (Misc queries) | |||
MODIFICATION IS NOT ALLOWED | Excel Worksheet Functions | |||
parameters not allowed | Excel Discussion (Misc queries) |