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: 1
Default Macro runs slowly only on new laptop

I have a macro that is linking to an indexed MS Access table using a .dqy to
pull data into the worksheet. There are two tabs in the worksheet and each
tab uses a different .dqy.

I just got a new laptop computer that has a faster processor and more memory
than what I had before, but now the macro takes about 2 minutes to run where
before it only took about 5 seconds.

The excel workbook is on a network drive, and when other users open it and
run the macro, it runs in the same 5 seconds. When I log on to the network
using a co-worker's computer and run the macro, it runs in 5 seconds.

I have the View Page Breaks unchecked, I tried manual calculation, and have
Application.ScreenUpdating = False in the VBA code.

Any ideas? Thanks.

Below is the code:

Sub refreshAW()
Application.ScreenUpdating = False
With ActiveSheet.QueryTables.Add(Connection:= _
"FINDER;M:\Data_Preparation\SALESTEAM
REPORTING\ADVISOR_WORKSHEET\2006\AW_WIR2.dqy" _
, Destination:=Range("A10"))
.Name = "AW_WIR2"
.FieldNames = False
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.SavePassword = True
.SaveData = True
.AdjustColumnWidth = False
.RefreshPeriod = 0
.PreserveColumnInfo = True
.refresh BackgroundQuery:=False
End With
Range("A10").Select
Cells.Find(What:="yyy", After:=ActiveCell, LookIn:=xlValues,
LookAt:= _
xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate


Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
Range("A9").Select



Range("A10").Select

ActiveSheet.Shapes("Text Box 459").Select
Selection.Delete

Sheets("BRANCHES").Select
Run ("refreshBW")

Sheets("ADVISORS").Select

Dim aclast As String
aclast = InputBox("Enter AC Last Name")


ChDir "M:\Data_Preparation\RIT_NAM_NWQ_DATA\Scorecards\W IREHOUSE_TEMPS"
ActiveWorkbook.SaveAs Filename:= _

"M:\Data_Preparation\RIT_NAM_NWQ_DATA\Scorecards\W IREHOUSE_TEMPS\ADVISOR_WORKSHEET_" & aclast & ".xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False


End Sub
Sub refreshBW()
Application.ScreenUpdating = False
With ActiveSheet.QueryTables.Add(Connection:= _
"FINDER;M:\Data_Preparation\SALESTEAM
REPORTING\ADVISOR_WORKSHEET\2006\BW_WIR2.dqy" _
, Destination:=Range("A10"))
.Name = "BW_WIR2"
.FieldNames = False
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.SavePassword = True
.SaveData = True
.AdjustColumnWidth = False
.RefreshPeriod = 0
.PreserveColumnInfo = True
.refresh BackgroundQuery:=False
End With
Range("A10").Select
Cells.Find(What:="yyy", After:=ActiveCell, LookIn:=xlValues,
LookAt:= _
xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate


Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
Range("A9").Select



Range("A10").Select



End Sub
 
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
VBA macro runs fine, but freezes if I try to do ANYTHING else whileit runs Rruffpaw Setting up and Configuration of Excel 1 September 17th 11 01:25 PM
WHY the same macro runs so slowly on a different but faster comput Jerry Excel Discussion (Misc queries) 2 August 15th 07 10:30 PM
Excel runs slowly, but only when connected to a network Pete Excel Discussion (Misc queries) 3 November 28th 05 08:25 PM
Excel 2000 macro runs v.slowly when Excel is not Active Window Mark Garratt Excel Programming 0 May 11th 04 09:18 AM
Excel runs slowly in the background Scott Woyak Excel Programming 4 December 4th 03 01:57 AM


All times are GMT +1. The time now is 10:58 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"