Excel querydef with Activex Controls

  • Can any one help me with this issue.

    I have activex controls on a sheet that gets data from a sql server via the querydef object. The control is on A2, Everytime I refresh the query, it gets moved to the right, how can I make sure that it is static in its position?

  • You should set the Range object to the location of the starting cell.

    Example: Range("A2").Select

    I would suggest that you record macros and perform certain tasks, then stop the macro and look at the code generated, it's the fastest and easiest way to learn how to reference objects in Excel.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply