ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   query afterrefresh not working (https://www.excelbanter.com/excel-programming/428328-query-afterrefresh-not-working.html)

[email protected]

query afterrefresh not working
 
Feel like such an idiot.. I cannot figure out what I am doing wrong.
Keep getting runtime error "9. Run-time error '9':
Subscript out of range"

Have copy pasted the code from
http://support.microsoft.com/default...b;en-us;182735

Am working on a Swedish version of 2007, meaning sheets in the project
browser syas Blad1(Blad1) instead of sheet1(sheet1) (hope you get my
drift) Am guess this is causing a problem but not sure where to change
what.

Any ideas. It is so frustrating!!!!! especially since lots of other
poeple have gotten it to word...

ryguy7272

query afterrefresh not working
 
I don't know anything about Sweedish Excel, but wo you actually have a Query
named QueryTables(1)? Can you rename a Sheet from Blad1 to Sheet1. If not,
you will certainly have to make a small change he
Set X.qt = Thisworkbook.Blad(1).QueryTables(1)

Good luck,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


" wrote:

Feel like such an idiot.. I cannot figure out what I am doing wrong.
Keep getting runtime error "9. Run-time error '9':
Subscript out of range"

Have copy pasted the code from
http://support.microsoft.com/default...b;en-us;182735

Am working on a Swedish version of 2007, meaning sheets in the project
browser syas Blad1(Blad1) instead of sheet1(sheet1) (hope you get my
drift) Am guess this is causing a problem but not sure where to change
what.

Any ideas. It is so frustrating!!!!! especially since lots of other
poeple have gotten it to word...


littleme

query afterrefresh not working
 
Im still not getting it to work!!

In classmodule named ClsModQT:
Public WithEvents qtQueryTable As QueryTable
Sub InitQueryEvent(QT As Object)
Set qtQueryTable = QT
End Sub

In module:
Dim clsQueryTable As New ClsModQT
Sub RunInitQTEvent()
clsQueryTable.InitQueryEvent _
QT:=ActiveSheet.QueryTables(1)
End Sub

Keep getting runtime error 9 at

clsQueryTable.InitQueryEvent _
QT:=ActiveSheet.QueryTables(1)

Even when change table name from (1) to ("Tabell_INSPI_ytor")

Am I misunderstanding something else fundamental. Query is from
another Excel table if that makes a difference....

HELP!! Feel like such an idiot


All times are GMT +1. The time now is 11:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com