Advertisement

07.31.2006 at 11:40PM PDT, ID: 21938680
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0

EXCEL Refresh Data Query Freezes computer CPU at 100% forever

Asked by nikdonovanau in Microsoft Office Suite

Tags:

In excel I have a workbook with 4 sheets that get their data from the server.

Its a simple offcut viewer program in excel

every time I try to refresh the data Excel locks up, the cpu usage peaks to 100% and stays there until I close the application.

If I click the excel toolbar (refresh data) it still locks up.

Please help.

The code I use follows

  Sheets(1).Select
    Selection.QueryTable.Refresh BackgroundQuery:=False

  Sheets(4).Select
    Selection.QueryTable.Refresh BackgroundQuery:=False

 Sheets(3).Select
    Selection.QueryTable.Refresh BackgroundQuery:=False

 Sheets(2).Select
    Selection.QueryTable.Refresh BackgroundQuery:=False

The result - FREEZE

Then I tried the following

Sub DOIT2()

Sheets("MAIN").Select
Application.ScreenUpdating = False
PROGRESSBAR.Show
PROGRESSBAR.Repaint
 Sheets("Offcuts Coloured Board 16").Select
   
     Cells.Select
    Range("A1").Activate
    Selection.ClearContents
   Range("A1").Select
    With ActiveSheet.QueryTables.Add(Connection:= _
        "TEXT;Y:\NIKS TOOLS\MATERIALS\Offcuts Coloured Board 16.STD", Destination:= _
        Range("A1"))
        .Name = "Offcuts Coloured Board 16_1"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .TextFilePromptOnRefresh = False
        .TextFilePlatform = 437
        .TextFileStartRow = 1
        .TextFileParseType = xlDelimited
        .TextFileTextQualifier = xlTextQualifierDoubleQuote
        .TextFileConsecutiveDelimiter = False
        .TextFileTabDelimiter = True
        .TextFileSemicolonDelimiter = False
        .TextFileCommaDelimiter = False
        .TextFileSpaceDelimiter = False
        .TextFileOtherDelimiter = "="
        .TextFileColumnDataTypes = Array(1, 1)
        .TextFileTrailingMinusNumbers = True
        .Refresh BackgroundQuery:=False
    End With
    Sheets("MAIN").Select
    Application.ScreenUpdating = True
    PROGRESSBAR.Hide
    PROGRESSBAR1.Show
    PROGRESSBAR1.Repaint
    Application.ScreenUpdating = False
    Sheets("colourtop16").Select
    Columns("A:C").Select
    Range("A3").Activate
    Selection.ClearContents
    Selection.QueryTable.Delete
    Range("A3").Select
    With ActiveSheet.QueryTables.Add(Connection:= _
        "TEXT;Y:\NIKS TOOLS\MATERIALS\Coloured Board Offcuts Top16.STD", Destination _
        :=Range("A3"))
        .Name = "Coloured Board Offcuts Top16"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .TextFilePromptOnRefresh = False
        .TextFilePlatform = 437
        .TextFileStartRow = 1
        .TextFileParseType = xlDelimited
        .TextFileTextQualifier = xlTextQualifierDoubleQuote
        .TextFileConsecutiveDelimiter = False
        .TextFileTabDelimiter = True
        .TextFileSemicolonDelimiter = False
        .TextFileCommaDelimiter = False
        .TextFileSpaceDelimiter = False
        .TextFileOtherDelimiter = "="
        .TextFileColumnDataTypes = Array(1, 1)
        .TextFileTrailingMinusNumbers = True
        .Refresh BackgroundQuery:=False
    End With
        Sheets("MAIN").Select
    Application.ScreenUpdating = True
    PROGRESSBAR1.Hide
    PROGRESSBAR2.Show
    PROGRESSBAR2.Repaint
    Application.ScreenUpdating = False
        'MDF AND PAINT BASE
   
   
        Sheets("MDF READ").Select
    Columns("A:C").Select
    Range("A3").Activate
    Selection.ClearContents
    Selection.QueryTable.Delete
    Range("A3").Select
    With ActiveSheet.QueryTables.Add(Connection:= _
        "TEXT;Y:\NIKS TOOLS\MATERIALS\Offcuts MDF Materials.STD", Destination _
        :=Range("A3"))
        .Name = "MDF Materials.STD"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .TextFilePromptOnRefresh = False
        .TextFilePlatform = 437
        .TextFileStartRow = 1
        .TextFileParseType = xlDelimited
        .TextFileTextQualifier = xlTextQualifierDoubleQuote
        .TextFileConsecutiveDelimiter = False
        .TextFileTabDelimiter = True
        .TextFileSemicolonDelimiter = False
        .TextFileCommaDelimiter = False
        .TextFileSpaceDelimiter = False
        .TextFileOtherDelimiter = "="
        .TextFileColumnDataTypes = Array(1, 1)
        .TextFileTrailingMinusNumbers = True
        .Refresh BackgroundQuery:=False
    End With
       
 
       
        Sheets("MAIN").Select
    Application.ScreenUpdating = True
    PROGRESSBAR2.Hide
    PROGRESSBAR3.Show
    PROGRESSBAR3.Repaint
    Application.ScreenUpdating = False
        Sheets("PAINT READ").Select
    Columns("A:C").Select
    Range("A3").Activate
    Selection.ClearContents
    Selection.QueryTable.Delete
    Range("A3").Select
    With ActiveSheet.QueryTables.Add(Connection:= _
        "TEXT;Y:\NIKS TOOLS\MATERIALS\Offcuts Paint Base.STD", Destination _
        :=Range("A3"))
        .Name = "Offcuts Paint Base"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .TextFilePromptOnRefresh = False
        .TextFilePlatform = 437
        .TextFileStartRow = 1
        .TextFileParseType = xlDelimited
        .TextFileTextQualifier = xlTextQualifierDoubleQuote
        .TextFileConsecutiveDelimiter = False
        .TextFileTabDelimiter = True
        .TextFileSemicolonDelimiter = False
        .TextFileCommaDelimiter = False
        .TextFileSpaceDelimiter = False
        .TextFileOtherDelimiter = "="
        .TextFileColumnDataTypes = Array(1, 1)
        .TextFileTrailingMinusNumbers = True
        .Refresh BackgroundQuery:=False
    End With
    PROGRESSBAR3.Hide
    Application.ScreenUpdating = True
Sheets("MAIN").Select


End Sub


STILL NO GO??Start Free Trial
 
 
[+][-]08.05.2006 at 01:28PM PDT, ID: 17256959

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Office Suite
Tags: excel
Sign Up Now!
Solution Provided By: Kelvin81
Participating Experts: 1
Solution Grade: A
 
 
[+][-]08.06.2006 at 08:29PM PDT, ID: 17261114

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32