+ Reply to Thread
Results 1 to 4 of 4

Help with Not Responding error while runnign a macro

  1. #1
    Registered User
    Join Date
    02-26-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2003
    Posts
    3

    Help with Not Responding error while runnign a macro

    Hi All,

    I am using the below macro to copy contents from sheet 1 where a web query refreshes into sheet 2.

    The sheet gets hung and freezes while running this code. The code works well when i run it using F8 in the editor.

    Please Login or Register  to view this content.
    Any help on this would be appreciated.

    Thanks
    Sudi

  2. #2
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: Help with Not Responding error while runnign a macro

    I gets stuck in an infinite loop if E4 is empty
    It copies once, refreshes the workbook ? Why? & then gets stuck in While/Wend
    What are you trying to do?

  3. #3
    Registered User
    Join Date
    02-26-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Help with Not Responding error while runnign a macro

    Hi,

    Let me explain more clearly.

    I have a web query running and it refreshes the tables. The reason why i have used E4 cell is to check if the query has refreshed or not. When the query refreshes it comes out of the loop and copies the values in G2:N2 which is consolidated result of the table using simple countif formula.

    The values in Col A are the values for which i need the relevant values from the table.

    The code worls fine when i run it using F8 barring it copies the values twice into sheet 2.

    Hope i was clear in explaining the scenario.

    Thanks in advance.

    Sudi

  4. #4
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: Help with Not Responding error while runnign a macro

    Hi Sudarshan
    Have you thought about a worksheet change macro? It means you won't get stuck in an infinite loop. Here's the code
    If it's of any interest to you, you could change it here & there to suit your needs
    I've attached a working sample for you to play with

    In Sheet(1)
    Please Login or Register  to view this content.
    In ThisWorkbook sheet. It enters 1 in sheet 1 D4 when workbook opens & deletes the cell when the workbook closes.
    The number is used to update the lng value in the change event macro. Change address if you like

    Please Login or Register  to view this content.
    In a standard module just for demonstration I put

    Please Login or Register  to view this content.
    Delete it if not required. Its only for demo purposes

    If anyone can improve on it, I'd be happy to see it. Always keen to learn
    Cheers
    Phil
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Disable a Private Sub Workbook_SheetSelectionChange when runnign a specific Macro
    By jshaw82 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-12-2013, 04:54 PM
  2. [SOLVED] Macro not responding
    By TERRI LEE in forum Excel Programming / VBA / Macros
    Replies: 30
    Last Post: 04-08-2013, 08:48 AM
  3. Replies: 2
    Last Post: 11-20-2011, 08:53 AM
  4. File size after runnign macro
    By r_dearn in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-25-2006, 04:44 AM
  5. Replies: 0
    Last Post: 12-22-2005, 03:35 AM

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