Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a macro with 10 modules stored in an .xlA file (this is not
installed in Excel using Tools - Add-Ins). The purpose of Module 1 is to open, on each business day, a workbook (it has only one worksheet with zero formulas, only strings and numbers; the preceding day's version is replaced), make a few minor changes, and save it to a shared drive (same path as the file that was opened); also, this file is attached to an Outlook e-mail and sent to an user group. It is desirable that when users open the e-mail and open the attachment, that the window be "maximized"; also, it is desirable that the shared drive workbook window be "maximized" when it is opened using Windows Explore and that, when both of these workbooks are shut down without the user having made any changes, that the user not receive the pop-up question - "Do you want to save the changes you made ...?". In the 'ThisWorkbook' module of my .xlA file, I have the following code: Option Explicit Private Sub Workbook_Open() Application.WindowState = xlMaximized End Sub Near the end of Module 1, I have the following code: ActiveWindow.WindowState = xlMaximized Application.Calculate SaveWorkBook oWBookOutPut The following applies to both the e-mail attachment and to the file stored on the shared drive: I am getting inconsistent results; most of the time, the new workbook opens in "xlNormal" size. Sometimes I am getting the "Do you want to save ...?" prompt and sometimes not when shutting down the file without making any changes; furthermore, when viewing the question prompt and selecting "No", and then re-opening each of the workbooks, sometimes I will not get the question prompt -- subsequent re-openings behave exactly the same. Lastly, I exported Module 1 and made it a freestanding macro. It behaves perfectly each time I run it. Does anyone have any ideas as to what is happening? Thanks for a response, JingleRock |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
HELP on "left","right","find","len","substitute" functions | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel | |||
freeze window creates multiple "views" suffixed with ":n" | Excel Discussion (Misc queries) |