LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default running macro after refresh of extenal data

My guess is that your worksheet isn't named RatesbyLevel. Maybe it has a
space on either end. or you don't have a querytable named qRatesByLevel.

As per your last statement, Yes, you do need to do something to tie your
class to the querytable.

--
Regards,
Tom Ogilvy

"djd" wrote in message
...
Thanks for the link. I have attempted to replicate the code but I am
getting
a subscript out of range error.
Here is the class
Public WithEvents qt As QueryTable

Private Sub qt_RebuildGeoLoc_AfterRefresh(ByVal Success As Boolean)
Dim m_iLastRow As Integer
Dim response As Integer
'*** Find last row
ActiveCell.SpecialCells(xlLastCell).Select
ActiveCell.Offset(rowoffset:=1, columnoffset:=0).Select
m_iLastRow = ActiveCell.Row
response = MsgBox(Prompt:="Active last cell is " + m_iLastRow,
Buttons:=vbInformation)
End Sub

Here is the module code
im x As New Class1
Sub RebuildGeoLoc()
Set x.qt =
ThisWorkbook.Sheets("RatesByLevel").QueryTables("q RatesByLevel")
End Sub

Opened the workbook and nothing happened so I added the following to the
Open event.
Call RebuildGeoLoc


"Tom Ogilvy" wrote:

http://support.microsoft.com/kb/213187/en-us
XL2000: How to Use the Query BeforeRefresh and AfterRefresh Events

--
Regards,
Tom Ogilvy


"djd" wrote in message
...
I have a worksheet that is populated with data from an external source.
I
need to go through the data on the worksheet and extract values that
will
be
used in a couple of lists in the workbook after the data has been
refreshed.
The refresh on open option is turned on. I added the code to the
workbook
open event but that results in the code executing prior to the prompt
to
refresh the external data. Is there another event where the code
should
be
located? Is there any other way that I can run the code after the
refresh
of
the external data?






 
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
EXCEL 2007 CHART REFRESH WHILE MACRO IS RUNNING MikeM Charts and Charting in Excel 1 April 20th 09 07:38 AM
Running a macro from an auto-refresh Chris Youlden Excel Worksheet Functions 2 October 7th 07 04:22 PM
Macro to Open the Menu Data,Refresh Data,filename,import Bob Excel Programming 0 February 11th 06 04:51 PM
running a macro on every refresh of the screen shovit sahai Excel Programming 5 March 2nd 05 10:56 PM
Auto refresh and DDE update is not work when running macro Eddy[_5_] Excel Programming 0 July 13th 04 10:08 AM


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