Share via

How to execute "Saved Export" via command line (or any programming language)?

chw 271 Reputation points
2021-12-26T08:43:49.323+00:00

Hello,

we use a "saved export" to export some data from another department. Now we have to do this export manually and I'd like to automate that step.

The only solution I have found is to create a macro which then runs the saved export. It does not work on my local machine due to security restrictions. So I was wondering if there is any other way to trigger a saved export or run those exports via command line (or any other programming language)?

Thanks!

Microsoft 365 and Office | Access | Development
0 comments No comments

1 answer

Sort by: Most helpful
  1. Ken Sheridan 3,571 Reputation points
    2021-12-28T00:43:49.833+00:00

    I assume that the data being exported are contained in a text file. You can call the TransferText method of the DoCmd object in VBA. This has a SpecificationName argument for use where the export specification has been saved. For details see:

    https://learn.microsoft.com/en-us/office/vba/api/access.docmd.transfertext

    You might find that you run up against the same 'security restrictions' as when using a macro of course, in which case I would advise that you contact your system administrator.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.