Thread: Possible bug?
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
funkymonkUK[_97_] funkymonkUK[_97_] is offline
external usenet poster
 
Posts: 1
Default Possible bug?


Hi I got Excell 2000

I have a piece of code which opens a workbook(a) and copys selecte
sheets to Workbook(B). I then close workbook (A) but do not want th
"do you want to save..." display to pop up so I wrote the followin
code to stop it from displaying the save option.

Application.DisplayAlerts = False
ActiveWorkbook.Close
Application.DisplayAlerts = True

If i step through my code as soon as I get to the close bit and move m
mouse over application.dis its telling me that it is true. which o
coarse make the save option pop up. so I wrote this code in case
turned the displayalerts off some where else.

If Application.DisplayAlerts = True Then Application.DisplayAlerts
False
ActiveWorkbook.Close
Application.DisplayAlerts = True

when I step through it picks it up as being true and does the then bi
and then carrys on as it still being true. it seems to be ignoring th
fact that I had made it false.

I know this works as I have other workbooks that do a similar thing.

Any Ideas

--
funkymonkU
-----------------------------------------------------------------------
funkymonkUK's Profile: http://www.excelforum.com/member.php...fo&userid=1813
View this thread: http://www.excelforum.com/showthread.php?threadid=51780