PQ not updating properely.

JeffGrant

Well-known Member
Joined
Apr 7, 2021
Messages
558
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I have been running a PQ scxript for some two years without a problem. The script simply combines two tables. No daram,.

Hopwever, in the last week, when the query runs, there is one field, that instead of updateing the text field, it simply add the text word DATE to every record.

By refreshing the table, every thing goes back to normal and the text field is updated correctly. No big deal, I can move the location of the code and solve it.

I am just wndering if anybody has seen anything like this and what was the solution?

Just opdd thatr it has workd for some two years.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Where do the two tables come from?
 
Upvote 0
Hi Rory
Update..... The table are generated from PQ Json api downloads. However, this sesm to be the issue:


This works
Sub Timer2RefreshRemoveScratchingsFromTodaysField()
Dim rng As Range
Dim tbl As ListObject

Sheet60.activate
Set tbl = Sheet60.ListObjects("RemoveScratchingsFromTodaysField")

Set rng = Sheet60.Range("A2")
rng.ListObject.QueryTable.Refresh BackgroundQuery:=False

End Sub

This does not.
This gives error 13, type mis-match at set ws = sheet60 line. I have used this format for the SET command in many places in the model without any issues.

Sub Timer2RefreshRemoveScratchingsFromTodaysField()
Dim ws As Worksheets
Dim rng As Range
Dim tbl As ListObject

set ws = Sheet60
Set tbl = ws.ListObjects("RemoveScratchingsFromTodaysField")

Set rng = ws.Range("A2")
rng.ListObject.QueryTable.Refresh BackgroundQuery:=False

End Sub

so I am little lost :-(

Thanks in advance for any suggestions.
 
Upvote 0
VBA Code:
Dim ws As Worksheets

needs to be:

VBA Code:
Dim ws As Worksheet
 
Upvote 0
Solution
HI Rory

I cant believe that I did that. It is so obvious.

Thanks man.
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,195
Members
453,021
Latest member
pingpong7117

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top