+ Reply to Thread
Results 1 to 7 of 7

Macro help...

  1. #1
    Registered User
    Join Date
    06-27-2005
    Posts
    22

    Arrow Macro help...

    I am running a macro that prompts asking if you would like to keep the data on the clipboard. The answer always needs to be yes and I was wondering is there code I can add to my macro that will automatically answer this question yes instead of prompting the user for the answer?

    Thanks for your help.

  2. #2
    Forum Contributor
    Join Date
    03-03-2005
    Posts
    315
    Comment out the line(s) of code that triggers off the message.

  3. #3
    Registered User
    Join Date
    06-27-2005
    Posts
    22
    Quote Originally Posted by davidm
    Comment out the line(s) of code that triggers off the message.
    I don't have a code to trigger the prompt. Below is the code where the prompt takes place.

    Workbooks.Open Filename:="I:\SECURED\B&H Reconciliations\" & Range("K5").Value & ".xls"
    Selection.Copy
    ActiveWindow.Close
    Sheets("Submit").Select
    ActiveSheet.PasteSpecial Format:="Unicode Text", Link:=False, _
    DisplayAsIcon:=False

    After the activewindow.close it then issues the prompt.

    Thanks for the advice!

    More help needed please...

  4. #4
    Forum Contributor
    Join Date
    03-03-2005
    Posts
    315
    After Selection.copy, insert

    Application.DisplayAlerts=False


    and before End Sub, close off with
    Application.DisplayAlerts=True
    -------------------------------------------------------------------------------
    Workbooks.Open Filename:="I:\SECURED\B&H Reconciliations\" & Range("K5").Value & ".xls"
    Application.DisplayAlerts=False
    Selection.Copy
    ActiveWindow.Close
    Sheets("Submit").Select
    ActiveSheet.PasteSpecial Format:="Unicode Text", Link:=False, _
    DisplayAsIcon:=False

    ...... ....... ........
    ...... ....... .........

    Application.DisplayAlerts=true
    End Sub

  5. #5
    Registered User
    Join Date
    06-27-2005
    Posts
    22
    Thanks so much!!!

  6. #6
    Hoshyar
    Guest

    Re: Macro help...

    Hi Davidm,

    I have the same problem, but as I am not a programmer, I couldn't understand
    your answer here. would you kindly explain what shall I do to stop the code
    that triggers this message?

    Thanks in advance
    Hoshyar

    "davidm" wrote:

    >
    > Comment out the line(s) of code that triggers off the message.
    >
    >
    > --
    > davidm
    > ------------------------------------------------------------------------
    > davidm's Profile: http://www.excelforum.com/member.php...o&userid=20645
    > View this thread: http://www.excelforum.com/showthread...hreadid=437380
    >
    >


  7. #7
    Registered User
    Join Date
    06-27-2005
    Posts
    22

    Smile

    Quote Originally Posted by Hoshyar
    Hi Davidm,

    I have the same problem, but as I am not a programmer, I couldn't understand
    your answer here. would you kindly explain what shall I do to stop the code
    that triggers this message?

    Thanks in advance
    Hoshyar
    Hello Hoshyar,

    Here is how I corrected the problem. You will need to find the code listed below:

    ActiveWindow.Close

    Then surround it by these two tags:

    Application.DisplayAlerts=False

    Application.DisplayAlerts=True


    So it should look like this:

    Application.DisplayAlerts=False
    ActiveWindow.Close
    Application.DisplayAlerts=True


    I hope this helps... It did for me!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1