Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 13th, 2006, 08:52 AM
Authorized User
 
Join Date: Apr 2006
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default excel freezes due to Application.DisplayAlerts

Hi all,

Im copying and pasting data from one workbook to another but when I want to close the source workbook, it comes up with this message that I have much data and if I want to keep this in a clipboard. I thought I could disable this with Application.DisplayAlerts = False but when I do this, Excel freezes. Im I doing something wrong

regardsPaul from Holland.





Public path As String


Sub Get_data()
'
' Get_data Macro

Application.DisplayClipboardWindow = False
'
path = "\\Nlchoosa.nl\OPS_Processes$\OPS_Processes\Report s\Sector performance\"

    Workbooks.Open Filename:=path & "Reports\Sector Performance Reporting week.xls"
    Range("A1").Select
    Range(Selection, Selection.End(xlToRight)).Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.copy
    Windows("Sector Performance report Week.xls").Activate
    ActiveSheet.Paste
    Application.DisplayClipboardWindow = False
    Windows("Sector Performance Reporting week.xls").Activate

    Application.DisplayAlerts = False

    ActiveWindow.Close SaveChanges:=False




End Sub


 
Old July 22nd, 2006, 02:41 AM
Authorized User
 
Join Date: Jul 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I put two new commands (*****) and it works. (see bellow)


Public path As String


Sub Get_data()
'
' Get_data Macro

Application.DisplayClipboardWindow = False
'
path = "\\Nlchoosa.nl\OPS_Processes$\OPS_Processes\Report s\Sector performance\"

    Workbooks.Open Filename:=path & "Reports\Sector Performance Reporting week.xls"
    Range("A1").Select
    Range(Selection, Selection.End(xlToRight)).Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.copy
    Windows("Sector Performance report Week.xls").Activate
    Range("A1").Select'******
    ActiveSheet.Paste
    Application.DisplayClipboardWindow = False
    Windows("Sector Performance Reporting week.xls").Activate

    Application.DisplayAlerts = False

    ActiveWindow.Close SaveChanges:=False
    Application.DisplayAlerts = True'*****

End Sub







Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Application dpkbahuguna Beginning VB 6 2 November 29th, 2006 06:49 AM
write multi-sheet Excel w/o Excel.Application manmoth Classic ASP Components 2 November 22nd, 2005 10:56 AM
Can't create ASP.Net web application due to port c Fero VS.NET 2002/2003 5 June 21st, 2004 04:52 PM
VB.NET freezes when debugging eff VB.NET 2 February 3rd, 2004 07:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.