Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem with Application.ScreenUpdating
Hi,
Is the purpose of Application.ScreenUpdating = False in an Excel macro supposed to "hide" changes to the workbook from the users? The worksheet that is being created by my macro displays and runs the commands so users can see even though I have Application.ScreenUpdating = False. I don't want anything to display. I am using Windows XP and MS Excel 2003. I have installed MS SP3 also. Why doesn't the Application.ScreenUpdating = False work? Thank you, |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem with Application.ScreenUpdating
For most people it works. Your experience is not typical. Perhaps if you
posted your code someone might be able to spot the cause. -- Regards, Tom Ogilvy "Betty" wrote in message ... Hi, Is the purpose of Application.ScreenUpdating = False in an Excel macro supposed to "hide" changes to the workbook from the users? The worksheet that is being created by my macro displays and runs the commands so users can see even though I have Application.ScreenUpdating = False. I don't want anything to display. I am using Windows XP and MS Excel 2003. I have installed MS SP3 also. Why doesn't the Application.ScreenUpdating = False work? Thank you, |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem with Application.ScreenUpdating
Betty,
I'm not exactly sure what you mean. Application.ScreenUpdating = False stops the display from changing while your macro is operating. This makes things run quicker and prevents the user from seeing a whole lot of annoying flickering stuff! However, once your macro has run, the changes that were made (values altered, workbooks created and so forth) will all be visible to the user unless you have closed or hidden them. Pete -----Original Message----- Hi, Is the purpose of Application.ScreenUpdating = False in an Excel macro supposed to "hide" changes to the workbook from the users? The worksheet that is being created by my macro displays and runs the commands so users can see even though I have Application.ScreenUpdating = False. I don't want anything to display. I am using Windows XP and MS Excel 2003. I have installed MS SP3 also. Why doesn't the Application.ScreenUpdating = False work? Thank you, |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem with Application.ScreenUpdating
Application.ScreenUpdating = False is not working.
Thank you for your help. Here is the code. Sorry it's a little long and messy. Sub Print_Stuff() ' doesn't seem to work... Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Sheets("Print_Template").Visible = True Application.Goto Reference:="template" Selection.Copy Set NewSheet = Worksheets.Add NewSheet.Name = "Print_All" ' For each entry in the list add a section to Print_All For Each c In Worksheets("OD_list").Range("loops").Cells If Abs(c.Value) 0 Then i = c.Value Worksheets("Print_All").Activate If i = 1 Then linkCell = "A1" Else linkCell = "A" & ((i - 1) * 87) End If Range(linkCell).Select ActiveSheet.Paste ActiveCell.FormulaR1C1 = i Else If c.Value = "" Then Exit For End If End If Next ' In each section added, hide two rows of lookup values For Each c In Worksheets("OD_list").Range("loops").Cells If Abs(c.Value) 0 Then i = c.Value If i = 1 Then cRow = 5 linkCell = "A5" Else cRow = (((i - 1) * 87) + 4) linkCell = "A" & (((i - 1) * 87) + 4) End If Range(linkCell).Select Selection.EntireRow.Hidden = True linkCell = "A" & (cRow + 1) Range(linkCell).Select Selection.EntireRow.Hidden = True ' Set page break If cRow 87 Then Worksheets("Print_All").Rows(cRow - 4).PageBreak = xlPageBreakManual End If Else If c.Value = "" Then Exit For End If End If Next ' Format for printing cRow = cRow + 81 linkCell = "S" & cRow Application.Calculation = xlCalculationAutomatic Worksheets("Print_All").Activate ActiveSheet.PageSetup.PrintArea = "$A$1:" & linkCell ActiveSheet.PageSetup.Zoom = 50 Worksheets("Print_All").Columns("T").PageBreak = xlPageBreakManual Worksheets("Print_All").DisplayPageBreaks = True Worksheets("Print_All").PrintPreview 'ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True NewSheet.Delete Sheets("Print_Template").Visible = False Application.ScreenUpdating = True End Sub -----Original Message----- For most people it works. Your experience is not typical. Perhaps if you posted your code someone might be able to spot the cause. -- Regards, Tom Ogilvy "Betty" wrote in message ... Hi, Is the purpose of Application.ScreenUpdating = False in an Excel macro supposed to "hide" changes to the workbook from the users? The worksheet that is being created by my macro displays and runs the commands so users can see even though I have Application.ScreenUpdating = False. I don't want anything to display. I am using Windows XP and MS Excel 2003. I have installed MS SP3 also. Why doesn't the Application.ScreenUpdating = False work? Thank you, . |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem with Application.ScreenUpdating
It worked fine for me. The only thing I saw was the printpreview screen and
a prompt about deleting sheets. If you want to suppress the prompt about deleting sheets Application.DisplayAlerts = False NewSheet.Delete Application.DisplayAlerts = True -- Regards, Tom Ogilvy "Betty" wrote in message ... Application.ScreenUpdating = False is not working. Thank you for your help. Here is the code. Sorry it's a little long and messy. Sub Print_Stuff() ' doesn't seem to work... Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Sheets("Print_Template").Visible = True Application.Goto Reference:="template" Selection.Copy Set NewSheet = Worksheets.Add NewSheet.Name = "Print_All" ' For each entry in the list add a section to Print_All For Each c In Worksheets("OD_list").Range("loops").Cells If Abs(c.Value) 0 Then i = c.Value Worksheets("Print_All").Activate If i = 1 Then linkCell = "A1" Else linkCell = "A" & ((i - 1) * 87) End If Range(linkCell).Select ActiveSheet.Paste ActiveCell.FormulaR1C1 = i Else If c.Value = "" Then Exit For End If End If Next ' In each section added, hide two rows of lookup values For Each c In Worksheets("OD_list").Range("loops").Cells If Abs(c.Value) 0 Then i = c.Value If i = 1 Then cRow = 5 linkCell = "A5" Else cRow = (((i - 1) * 87) + 4) linkCell = "A" & (((i - 1) * 87) + 4) End If Range(linkCell).Select Selection.EntireRow.Hidden = True linkCell = "A" & (cRow + 1) Range(linkCell).Select Selection.EntireRow.Hidden = True ' Set page break If cRow 87 Then Worksheets("Print_All").Rows(cRow - 4).PageBreak = xlPageBreakManual End If Else If c.Value = "" Then Exit For End If End If Next ' Format for printing cRow = cRow + 81 linkCell = "S" & cRow Application.Calculation = xlCalculationAutomatic Worksheets("Print_All").Activate ActiveSheet.PageSetup.PrintArea = "$A$1:" & linkCell ActiveSheet.PageSetup.Zoom = 50 Worksheets("Print_All").Columns("T").PageBreak = xlPageBreakManual Worksheets("Print_All").DisplayPageBreaks = True Worksheets("Print_All").PrintPreview 'ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True NewSheet.Delete Sheets("Print_Template").Visible = False Application.ScreenUpdating = True End Sub -----Original Message----- For most people it works. Your experience is not typical. Perhaps if you posted your code someone might be able to spot the cause. -- Regards, Tom Ogilvy "Betty" wrote in message ... Hi, Is the purpose of Application.ScreenUpdating = False in an Excel macro supposed to "hide" changes to the workbook from the users? The worksheet that is being created by my macro displays and runs the commands so users can see even though I have Application.ScreenUpdating = False. I don't want anything to display. I am using Windows XP and MS Excel 2003. I have installed MS SP3 also. Why doesn't the Application.ScreenUpdating = False work? Thank you, . |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem with Application.ScreenUpdating
I found the reason why it is not working.
Application.ScreenUpdating = False should work. However, if you use Select or Selection then ScreenUpdating is set back to True. I repeated Application.ScreenUpdating = False after each occurrence. And it does what I expect. -----Original Message----- Application.ScreenUpdating = False is not working. Thank you for your help. Here is the code. Sorry it's a little long and messy. Sub Print_Stuff() ' doesn't seem to work... Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Sheets("Print_Template").Visible = True Application.Goto Reference:="template" Selection.Copy Set NewSheet = Worksheets.Add NewSheet.Name = "Print_All" ' For each entry in the list add a section to Print_All For Each c In Worksheets("OD_list").Range ("loops").Cells If Abs(c.Value) 0 Then i = c.Value Worksheets("Print_All").Activate If i = 1 Then linkCell = "A1" Else linkCell = "A" & ((i - 1) * 87) End If Range(linkCell).Select ActiveSheet.Paste ActiveCell.FormulaR1C1 = i Else If c.Value = "" Then Exit For End If End If Next ' In each section added, hide two rows of lookup values For Each c In Worksheets("OD_list").Range ("loops").Cells If Abs(c.Value) 0 Then i = c.Value If i = 1 Then cRow = 5 linkCell = "A5" Else cRow = (((i - 1) * 87) + 4) linkCell = "A" & (((i - 1) * 87) + 4) End If Range(linkCell).Select Selection.EntireRow.Hidden = True linkCell = "A" & (cRow + 1) Range(linkCell).Select Selection.EntireRow.Hidden = True ' Set page break If cRow 87 Then Worksheets("Print_All").Rows(cRow - 4).PageBreak = xlPageBreakManual End If Else If c.Value = "" Then Exit For End If End If Next ' Format for printing cRow = cRow + 81 linkCell = "S" & cRow Application.Calculation = xlCalculationAutomatic Worksheets("Print_All").Activate ActiveSheet.PageSetup.PrintArea = "$A$1:" & linkCell ActiveSheet.PageSetup.Zoom = 50 Worksheets("Print_All").Columns("T").PageBreak = xlPageBreakManual Worksheets("Print_All").DisplayPageBreaks = True Worksheets("Print_All").PrintPreview 'ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True NewSheet.Delete Sheets("Print_Template").Visible = False Application.ScreenUpdating = True End Sub -----Original Message----- For most people it works. Your experience is not typical. Perhaps if you posted your code someone might be able to spot the cause. -- Regards, Tom Ogilvy "Betty" wrote in message .. . Hi, Is the purpose of Application.ScreenUpdating = False in an Excel macro supposed to "hide" changes to the workbook from the users? The worksheet that is being created by my macro displays and runs the commands so users can see even though I have Application.ScreenUpdating = False. I don't want anything to display. I am using Windows XP and MS Excel 2003. I have installed MS SP3 also. Why doesn't the Application.ScreenUpdating = False work? Thank you, . . |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem with Application.ScreenUpdating
I am sure littering your code with ScreenUpdating settings solves the
problem, but for everyone else, using Select or Selection does not alter the ScreenUpdating setting. In fact, the main use of ScreenUpdating is to mask such behavior. And as I said, you code ran fine for me as written. Perhaps you have some event code firing that is resetting the Screenupdating. -- Regards, Tom Ogilvy "Betty" wrote in message ... I found the reason why it is not working. Application.ScreenUpdating = False should work. However, if you use Select or Selection then ScreenUpdating is set back to True. I repeated Application.ScreenUpdating = False after each occurrence. And it does what I expect. -----Original Message----- Application.ScreenUpdating = False is not working. Thank you for your help. Here is the code. Sorry it's a little long and messy. Sub Print_Stuff() ' doesn't seem to work... Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Sheets("Print_Template").Visible = True Application.Goto Reference:="template" Selection.Copy Set NewSheet = Worksheets.Add NewSheet.Name = "Print_All" ' For each entry in the list add a section to Print_All For Each c In Worksheets("OD_list").Range ("loops").Cells If Abs(c.Value) 0 Then i = c.Value Worksheets("Print_All").Activate If i = 1 Then linkCell = "A1" Else linkCell = "A" & ((i - 1) * 87) End If Range(linkCell).Select ActiveSheet.Paste ActiveCell.FormulaR1C1 = i Else If c.Value = "" Then Exit For End If End If Next ' In each section added, hide two rows of lookup values For Each c In Worksheets("OD_list").Range ("loops").Cells If Abs(c.Value) 0 Then i = c.Value If i = 1 Then cRow = 5 linkCell = "A5" Else cRow = (((i - 1) * 87) + 4) linkCell = "A" & (((i - 1) * 87) + 4) End If Range(linkCell).Select Selection.EntireRow.Hidden = True linkCell = "A" & (cRow + 1) Range(linkCell).Select Selection.EntireRow.Hidden = True ' Set page break If cRow 87 Then Worksheets("Print_All").Rows(cRow - 4).PageBreak = xlPageBreakManual End If Else If c.Value = "" Then Exit For End If End If Next ' Format for printing cRow = cRow + 81 linkCell = "S" & cRow Application.Calculation = xlCalculationAutomatic Worksheets("Print_All").Activate ActiveSheet.PageSetup.PrintArea = "$A$1:" & linkCell ActiveSheet.PageSetup.Zoom = 50 Worksheets("Print_All").Columns("T").PageBreak = xlPageBreakManual Worksheets("Print_All").DisplayPageBreaks = True Worksheets("Print_All").PrintPreview 'ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True NewSheet.Delete Sheets("Print_Template").Visible = False Application.ScreenUpdating = True End Sub -----Original Message----- For most people it works. Your experience is not typical. Perhaps if you posted your code someone might be able to spot the cause. -- Regards, Tom Ogilvy "Betty" wrote in message .. . Hi, Is the purpose of Application.ScreenUpdating = False in an Excel macro supposed to "hide" changes to the workbook from the users? The worksheet that is being created by my macro displays and runs the commands so users can see even though I have Application.ScreenUpdating = False. I don't want anything to display. I am using Windows XP and MS Excel 2003. I have installed MS SP3 also. Why doesn't the Application.ScreenUpdating = False work? Thank you, . . |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem with Application.ScreenUpdating
Sorry to bump an old thread, but I'm having a similar problem.
On 2 machines, one desktop, one laptop, both running Excel 2000 unde Windows XP, both running same code. One machine (desktop) the screenupdating is always TRUE, so the macr takes forever to run and the screen flashes/flip constantly. On th laptop however screenupdating works as expected. Is there maybe an option setting in Excel that could be preventing th screenupdating from working the same between two machines? Or a setting in Windows that could be conflicting with it -- Message posted from http://www.ExcelForum.com |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem with Application.ScreenUpdating
Has this been tried?
Application.ScreenUpdating = False Application.DisplayAlerts = False at the beginning of eacg piece of code to execute. HTH. Jim "OldRod " wrote in message ... Sorry to bump an old thread, but I'm having a similar problem. On 2 machines, one desktop, one laptop, both running Excel 2000 under Windows XP, both running same code. One machine (desktop) the screenupdating is always TRUE, so the macro takes forever to run and the screen flashes/flip constantly. On the laptop however screenupdating works as expected. Is there maybe an option setting in Excel that could be preventing the screenupdating from working the same between two machines? Or a setting in Windows that could be conflicting with it? --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Why does Selection.PasteSpecial toggle Application.ScreenUpdating | Excel Worksheet Functions | |||
How to set Application.ScreenUpdating = False for Gen use | Excel Discussion (Misc queries) | |||
Application.ScreenUpdating function question | Excel Worksheet Functions | |||
application.screenupdating problems and IE browser window | Excel Programming | |||
Application.ScreenUpdating = False | Excel Programming |