LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 138
Default Excel file using unusual amunt of resources

Hi,

I have an Excel file that seems to use an unusual amount of resources. By
just opening the file it uses 50% of CPU power. If I leave it open for some
time it eventually hangs and i need to end the task.

I am running XPSP3, Off2k3 on a dual core2 3.2ghz with 4gb mem so resources
should be fine. The file is also only 2mb in size.

I have narrowed the problem down to 1 worksheet. If I delete this worksheet
the problem is fixed (but obviously I wish to keep it).

At this point I would appreciate any ideas on what is wrong with this
worksheet and how to fix it.

The sheet details
- Has only a few formulas and it not massive i.e. Report is in range A1 to Y42
- Has a query table
- The query table is refreshed with the following marco but does not update
automatically on open...

Sub getQuote()

Dim QuerySheet As Worksheet, DataSheet As Worksheet
Dim qurl As String, qStart As String
Dim i As Integer
Dim nQuery As Name

Application.ScreenUpdating = False
Application.DisplayAlerts = False

Set DataSheet = ActiveSheet
Set queryDef = Sheets("queryDef")
qStart = "C7"

Range(qStart).CurrentRegion.ClearContents

i = 7
qurl = "http://finance.yahoo.com/d/quotes.csv?s=" + Cells(i, 1)
i = i + 1
While Cells(i, 1) < ""
qurl = qurl + "+" + Cells(i, 1)
i = i + 1
Wend
qurl = qurl + "&f=" + queryDef.Range("B2")
queryDef.Range("B1") = qurl

QueryQuote:
With ActiveSheet.QueryTables.Add(Connection:="URL;" & qurl,
Destination:=DataSheet.Range(qStart))
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With

Range(qStart).CurrentRegion.TextToColumns
Destination:=Range(qStart), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, other:=False

Columns("C:C").EntireColumn.AutoFit

Application.DisplayAlerts = True
Application.ScreenUpdating = True
Range("A5").Select

End Sub


Any suggestions people?

Bruce
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving Excel file locks up all memory resources, accesses externalfile? [email protected] Excel Discussion (Misc queries) 4 December 21st 07 11:01 PM
Unusual File Size in Excel file Teck Excel Discussion (Misc queries) 2 January 12th 07 01:52 AM
Unusual Excel error message [email protected] Excel Programming 3 May 2nd 06 07:17 PM
Unusual excel behaivor causes crash... Magically linked worksheets?? Why?! Mike Mertes Excel Programming 2 November 3rd 05 01:21 PM


All times are GMT +1. The time now is 07:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"