Skip to Content
Former Member
Oct 17, 2005 at 07:06 PM

Refreshing queries from VBA that expect prompted values


Please consider:

Run "SAPBEX.XLA!SAPBEXrefresh", False, SAP01.Names("SAPBEXq0001").RefersToRange

(SAP01 is my code name for SAPBEXqueries.)

Assuming the query requires a date for refresh, I would expect the following to work:

Run "SAPBEX.XLA!SAPBEXrefresh", False, SAP01.Names("SAPBEXq0001").RefersToRange, format(Date,"mm/dd/yy")

but it does not... replying, 'invalid # of arguments'.

So I tried:

Run "SAPBEX.xla! SAPBEXSetFilterValue", Format(Date, "mm/dd/yy"), "", BEXD02.Range("ab6")

(BEXD02 being the codename of the query embedded sheet.)

but no dice.