Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Macro Security

Hi, Can any body tell me if there is a code I can use that will set the
Macro Security to low when the workbook is opened and then return to high
when the workbook is shut down. I work on a network where the default is set
to high.

thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Macro Security

If you could use code to set security to low, security settings would be
useless as a tool to prevent malicious code.

If security is high, unsigned workbooks won't run code so how would you get
the code to run in any case?


Gord Dibben MS Excel MVP

On Wed, 4 Mar 2009 14:58:06 -0800, will07
wrote:

Hi, Can any body tell me if there is a code I can use that will set the
Macro Security to low when the workbook is opened and then return to high
when the workbook is shut down. I work on a network where the default is set
to high.

thanks


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Macro Security

People forget the SQL's are long strings try this

SelectSQL = _
"SELECT DISTINCT v_inputfiles.sName AS 'Client Name'," & _
"ciSE.ciSEqty," & _
"ciSE.ciSEvalue," & _
"ciSE.ciSECharge," & _
"ciSE.ciSEInRefSource," & _
"ciSE.ciSEInRefData"

FromSQL = _
"FROM chronosv2.dbo.ciSE ciSE," & _
"chronosv2.dbo.v_inputfiles v_inputfiles"

WhereSQL = _
"WHERE ciSE.ciSEclient = v_inputfiles.sID AND " & _
"((ciSE.ciSEbillingmonth='2008-10'))"

GroupSQL = _
"GROUP BY v_inputfiles.sName, " & _
"ciSE.ciSEID, " & _
"ciSE.ciSEqty, " & _
"ciSE.ciSEvalue, " & _
"ciSE.ciSECharge, " & _
"ciSE.ciSEInRefSource," & _
"ciSE.ciSEInRefData"

HavingSQL = _
"HAVING (ciSE.ciSEInRefSource='TM') AND (ciSE.ciSEInRefData='ELIST')"

Sql = SelectSQL & FromSQL & WhereSQL & HavingSQL


"will07" wrote:

Hi, Can any body tell me if there is a code I can use that will set the
Macro Security to low when the workbook is opened and then return to high
when the workbook is shut down. I work on a network where the default is set
to high.

thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Macro Security

did you try to overdrive your excel file with vb script.
something like this:

'Dim ex As Excel.Application 'Application Excel
'Dim wb As Excel.Workbook 'Classeur Excel
'Dim ws As Excel.Worksheet 'Feuille Excel

Set ex = CreateObject("Excel.Application")
ex.Visible = True
Function GetPath()
Dim path
path = WScript.ScriptFullName
WScript.Echo path
GetPath = Left(path, InStrRev(path, "\"))
End Function
p=getpath()
Set feuille = ex.Workbooks.Open(p &"\your_excel_file.xls")
set wb=ex.activeworkbook
Set ws = wb.ActiveSheet
ex.run "macro1",5
wb.save
wb.Close 'Fermeture du classeur Excel
ex.Quit'Fermeture de l'application Excel

Set ws = Nothing
Set wb = Nothing
Set ex = Nothing


"will07" a écrit dans le message de
...
Hi, Can any body tell me if there is a code I can use that will set the
Macro Security to low when the workbook is opened and then return to high
when the workbook is shut down. I work on a network where the default is
set
to high.

thanks


--
Michel Angelosanto, Bordeaux
Dernières mises Ã* jour du site Voyage au pays Internet
http://angelosa.free.fr/index.php?t=8

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
Avoid Outlook macro security for Excel bades macro blackbox via OfficeKB.com Excel Programming 4 June 15th 07 08:51 AM
Macro needed to set macro security in Excel to minimum Carl Excel Programming 3 March 18th 06 03:36 PM
Macro Security? bill Excel Discussion (Misc queries) 1 February 12th 06 10:27 PM
Macro Security Clementius Excel Discussion (Misc queries) 4 September 13th 05 01:37 AM
Macro Security Clementius Excel Programming 4 September 13th 05 01:37 AM


All times are GMT +1. The time now is 08:40 AM.

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

About Us

"It's about Microsoft Excel"