Avatar of Dale Fye
Dale FyeFlag for United States of America

asked on 

Need to paste a recordset into Excel starting at a specific row and column

I'm having a brain cramp this afternoon!

In my Access application, I need to write a number of recordsets to specific locations on an Excel worksheet, but the upper left cell in each instance will be dynamic.  Why does this work:
oSht.Range("A2").CopyFromRecordset rs

Open in new window

But this doesn't:
oSHT.Range(oSHT.Cells(rsItems!Row, rsItems!Col)).CopyFromRecordset rsData

Open in new window

Microsoft AccessMicrosoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
aikimark
ASKER CERTIFIED SOLUTION
Avatar of aikimark
aikimark
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

ASKER

aikimark,

Nope, thought I had to use a range. but that worked like a charm!
Avatar of aikimark
aikimark
Flag of United States of America image

Dale

.Cells() is (returns) a range object.
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo