How to force Excel to turn on macro when open?

hon

Board Regular
Joined
Oct 10, 2005
Messages
73
Last night, our discussion led to the conclusion that it is impossible to remove the macro on filesave as it depends on the user turning on the macro in the first place.

Today, I concluded that it is impossible to force users to turn on the macro. But my last question is 'Is it possible not to load macro when a user chooses not to turn on the macro?' (by some form of setting I was hoping). I guess it is not possible either :(
 

Tom Urtis

MrExcel MVP
Joined
Feb 10, 2002
Messages
11,197
hon said:
Last night, our discussion led to the conclusion that it is impossible to remove the macro on filesave as it depends on the user turning on the macro in the first place.
It concluded with the ability for the administrator of the file in your comapny's intranet creating a new workbook with the macro I posted, to delete all code out of the subject workbook, and send that to the final destination user, unless, as Isaid then the code removal is done manually by said admin if this is a one time deal.

hon said:
Today, I concluded that it is impossible to force users to turn on the macro.
If that means, impossible to enable another user's macro securtty settings, then your conclusion is correct, it's impossible.

hon said:
But my last question is 'Is it possible not to load macro when a user chooses not to turn on the macro?' (by some form of setting I was hoping). I guess it is not possible either :(
If you mean, somehow delete the code in the workbook if the user does not enable macros, the answer is no, since it would require automation to do so that is disallowed at that point by the user. As you have seen, there is a way to tell the user the consequences of not enabling their macros, because now they won't get the benefit of the coded enhancements, but you cannot force them to do anything or make the workbook "not load code" if the local settings do not allow for macro execution.
 

hon

Board Regular
Joined
Oct 10, 2005
Messages
73
"not to load macro when a user chooses not to turn on the macro"

It would be a very handy feature if Microsoft can implement it in future releases.
 

pfarmer

Well-known Member
Joined
Jul 6, 2005
Messages
550
hon said:
Just want to find out if it is possible to force Excel to turn on macro when open.
You can't force Excel to enable macros on start. However for the most part you can force the user to do so to use the sheet.

To do this do a search on the subject and note that you can make various sheets hidden with a macro when the workbook is closed. If you were then to reopen the workbook without macros enabled then the sheets you want to use are hidden, possibly with only one available telling the user to restart with macros enabled, if he does then that sheet gets hidden and the others are unhidden.

If you don't want to allow them to save the sheet to a location other then the desired location then use a macro to disable the various save commands from the menu and use a save button.

Personally on a properly protected network, I think there should be a way of autoenabling macros possibly with a runtime version of excel for those files.
That is if a workbook is located in a protected location it would be launched with a runtime version of excel where the security issue of the macro would not be an issue since an administrator would place it there in the first place.

Perry
 

Forum statistics

Threads
1,084,738
Messages
5,379,524
Members
401,611
Latest member
CandaceR68

Some videos you may like

This Week's Hot Topics

  • VBA code giving errors and stopping Excel
    Hello Experts, I have this code being used to loop through files in a file path, and copy specific data to another sheet. It is giving me several...
  • Disable MsgBox message
    Morning, I have a userform where if i leave a ComboBox empty i see a MsgBox warning me that i must enter an invoice number. It is this MsgBox i...
  • Macro Recorder into VBA, Copy Paste Data Filled Cells
    Hi Everyone, I have a macro recorder file that takes a selection of data, copies, then pastes into a new sheet on ("A2:B2") The issue is my...
  • Number format changes while pasting into a cell
    Hi, I am trying to paste a number 180204524303 from an email to an excel cell, however, whenever i try to do so , the the paste value appears as...
  • Collating data
    Hello all. Could someone please help. I am trying to pull all column data from multiple sheets (24 I total so far) into 1 master sheet without...
  • Sum Multiple Columns Based on Multiple Criteria
    I am trying to consolidate data by summing columns G through M based on material, plant, vendor, and fiscal year being identical. The period does...
Top