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

I am working with an excel spreadsheet which i want to execute macros o
opening. i have tried to put the code in the workbook open event but th
user screen maco is not executed.
when i remove the screenupdating the userscreen macro works, howeve
this is not suitable as the report macro is quite long and cycle
through a number of sheets. This problem also occurs wit
displayalerts=false

Please see the code below.

Private Sub Workbook_Open()
Application.ScreenUpdating = False
Application.Run "UserScreen"
Application.Run "Report"
End Sub

User screen is as folows:

Sheets("Alarm Analysis").Select
Application.Run "Set_User_Screen"
Application.Run "Background"

this is repeated for 9 other sheets

This is the report macro, the main function of the spreadsheet.

Sub Report()

Sheets("Alarm Analysis").Activate
ActiveWorkbook.RefreshAll

Sheets("Main Menu").Select

Dim DataWorkbook As Workbook
Dim SaveFileName As String

If MsgBox("Do you want to create a Report?", vbQuestion + vbYesNo
= vbYes Then
Application.Run "Info"
Set DataWorkbook = ActiveWorkbook

Sheets(Array("Alarm Analysis", "Alarm Type-Door", "Main Menu"
"Clearance Times", "Alarm Type-Intruder", _
"Alarm Type-Fire", "Alarm Type-Panic"
"Clearance-Incident Acknowledged", _
"Clearance-False Alarm", "Clearance-System Test"
"Clearance-User Input", _
"Alarm Activations", "Programs Activated", "Ful
Report", "AlarmClearancesC", "AlarmclTimeC", "AlarmtypeC"
"AlarmClearanceC", "ProgramActivationsC")).Copy

SaveFileName = "C:\Documents an
Settings\ajohnston01.VMSGLAS.000\My Documents\Report_" & format(Now
"dd_mm_yyyy") & ".xls"
ActiveWorkbook.saveas Filename:=SaveFileName
MsgBox "New Report Created and Saved As " & SaveFileName
'Application.Run ("ActiveWorkbook_Zip_Mail")

If MsgBox("Would you like to view the current report?"
vbQuestion + vbYesNo) = vbNo Then
ActiveWorkbook.Close
Workbooks("Titan Vision.xls").Activate
Application.Run "Clearall"
Application.Run "clearClearanceTimes"
Sheets("Main Menu").Select

End If

Else

Workbooks("Titan Vision.xls").Activate
ActiveWorkbook.Close
Sheets("Main Menu").Select

End If

Application.Run ("UserScreen")
Sheets("Main Menu").Activate

End Sub

Set user screen removes all commandbars and column and row headings.
Background selects a image to be used in each sheet.

Any help at all would be great

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default screenupdating workbook open

So
Application.Run "UserScreen"

should be before Screenupdating is set to false. You can reset
ScreenUpdating as often as you wish.


---
Message posted from http://www.ExcelForum.com/

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
How to: Open closed workbook/Search data tables/Return data to open workbook Hugh Adams Excel Discussion (Misc queries) 0 August 18th 10 02:04 PM
Opening Excel, Book1 opens, remains open with other workbook open DanieB Excel Discussion (Misc queries) 0 September 3rd 09 08:23 AM
how do i open a data workbook when i open a timesheet workbook [email protected] uk Excel Discussion (Misc queries) 2 January 4th 09 04:50 PM
excel 2003 saved file will not open without a blank workbook open Bob Excel Discussion (Misc queries) 4 November 11th 06 04:24 PM
workbooks.open and appliciation.screenupdating Suzie Wilks Excel Programming 2 February 26th 04 04:50 PM


All times are GMT +1. The time now is 12:26 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"