View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_4_] Jim Thomlinson[_4_] is offline
external usenet poster
 
Posts: 1,119
Default difficult but supposing not imposible

Application settings should only be modified in procedures that start and
finish while the user is locked out of the sheets. You can use them with
click events or change events, but you should not use them with open or close
events. Otherwise you are creating side effects (unwanted changes that are
not a part of the functionallity of the called procedures). The idea is to
make your modifications and then immediately clean up after yourself so the
user is non the wiser as to what you did.
--
HTH...

Jim Thomlinson


"filo666" wrote:

Hi, I'm tryng to accomplish something:
there is somehow save the excells aplication options before start to run a
program, disable them and when your programs ends enable them again.

For example:
I don't want in my program that the automatic calculation is disabled, so in
a auto_open() sub I wrote application.Calculation = xlAutomatic, then ina a
auto_close() sub I put manual calculation.
The problem is that I have 30 users, and they are very angry with me because
each time they use my program in his computer all excells is badly
configurated.
there is some way to save the actual excells state.
look the code attached so you cand understand the problemtatic
my program works just if in the auto_open() sub appears the following code:

Sub customized()
With Application
.CellDragAndDrop = False
.FixedDecimal = False
.FixedDecimalPlaces = 2
.AskToUpdateLinks = False
.MoveAfterReturnDirection = xlToRight
.EnableAutoComplete = False
.EnableAnimations = False
.DisplayPasteOptions = False
.DisplayInsertOptions = False
.ReferenceStyle = xlA1
.IgnoreRemoteRequests = False
.PromptForSummaryInfo = False
.DisplayRecentFiles = False
.StandardFont = "Arial"
.StandardFontSize = "10"
.RecentFiles.Maximum = 0
.EnableSound = False
.RollZoom = False
.DisplayFunctionToolTips = False
.MapPaperSize = True
.DecimalSeparator = "."
.ThousandsSeparator = ","
.UseSystemSeparators = False
.AutoRecover.Enabled = False
.ShowStartupDialog = False
.DisplayFormulaBar = False
.DisplayStatusBar = False
.DisplayCommentIndicator = 0
.ShowWindowsInTaskbar = False
.Calculation = xlAutomatic
With ActiveWindow
.DisplayFormulas = False
.DisplayGridlines = False
.DisplayHeadings = False
.DisplayOutline = False
.DisplayZeros = False
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = False
.DisplayWorkbookTabs = False
End With
ActiveSheet.DisplayAutomaticPageBreaks = False
ActiveWorkbook.DisplayDrawingObjects = xlAll

End Sub

TIA