LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old April 25th 06, 05:04 AM posted to microsoft.public.excel.programming
Junior Member
First recorded activity by ExcelBanter: Oct 2006
Posts: 21
Default Excel 2003 VBA - "Maximizing" Window & "Calculating" Workbook

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

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
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,

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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
freeze window creates multiple "views" suffixed with ":n" dgaex001 Excel Discussion (Misc queries) 5 March 22nd 06 06:28 PM

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

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

About Us

"It's about Microsoft Excel"


Copyright © 2017