Using Excel COM to paste from an object into cell range?

Get help with using AutoHotkey and its commands and hotkeys
JackPJ
Posts: 18
Joined: 19 Oct 2016, 05:52

Using Excel COM to paste from an object into cell range?

07 Aug 2017, 04:53

Hi all,

I'm trying to work out how to paste or insert an object (returned data from a SQL query) into excel.

This is an example of the code I have so far :

Code: Select all

lrAllDataSQLQuery := "SELECT * FROM EXAMPLETABLE"
lrAllDataObject := ADOSQL(ConnectionString,lrAllDataSQLQuery)
I can access individual items like this :

Code: Select all

lrAllDataObject[2,1]
But rather than cycle through every one and using "xl.Range("A1").value := xxxx", I'd rather be able to set the whole range to the object if that's possible.

Any ideas?

Thanks
kon
Posts: 1756
Joined: 29 Sep 2013, 17:11

Re: Using Excel COM to paste from an object into cell range?

07 Aug 2017, 09:16

Maybe a SafeArray. Here's some examples I wrote of SafeArrays.

Return to “Ask For Help”

Who is online

Users browsing this forum: BreezeB, jemmm, marcefw, Odlanir and 208 guests