Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Are the macros allowed?

I would like to thank you for your answers!

Milan
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
allowed/taken Martha Excel Worksheet Functions 1 July 12th 07 04:07 PM
allowed / taken Martha Excel Worksheet Functions 3 July 11th 07 07:56 PM
What does No More Fonts Allowed in Workbook mean? Tina Excel Discussion (Misc queries) 5 July 7th 06 05:35 PM
MODIFICATION IS NOT ALLOWED lisasbulldogs Excel Worksheet Functions 1 May 31st 06 06:27 PM
parameters not allowed begrry Excel Discussion (Misc queries) 0 May 3rd 05 03:56 PM


All times are GMT +1. The time now is 05:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"