troubleshooting Question

Change docmd from Export to paste into specified range

Avatar of route217
route217Flag for United Kingdom of Great Britain and Northern Ireland asked on
Microsoft Access
10 Comments1 Solution400 ViewsLast Modified:
Hi Experts

How would i change the following VBA from exporting the data from an Access table into a new worksheet to pasting the data into the following range as shown below:

DoCmd.TransferSpreadsheet acExport, 8, "Report1", FilePath, True, "A1"
DoCmd.TransferSpreadsheet acExport, 8, "Report2", FilePath, True, "A2"
DoCmd.TransferSpreadsheet acPaste, 8, "Report3", FilePath, True, "A3"


Set xlApp = New Excel.Application
xlApp.Visible = False
xlApp.DisplayAlerts = False

Set xlBook = xlApp.Workbooks.Open(FilePath)
Set xlSheet = xlBook.Worksheets(1)
Set xlRange = xlSheet.Range("b10:g17")
Set xlSheet2 = xlBook.Worksheets(2)
Set xlRange2 = xlSheet.Range("b10:F17")
Set xlSheet3 = xlBook.Worksheets(3)
Set xlRange3 = xlSheet.Range("b10:F17")
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 10 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros