2 folder creation and file copy process questions from a newbie

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Labman
Newbie
Posts: 1
Joined: Wed Sep 26, 2018 11:19 pm

2 folder creation and file copy process questions from a newbie

Post by Labman » Mon Oct 01, 2018 12:00 am

Good afternoon,

Background: I currently have a 3 macros that are associated with a single overall documents preparation process.

The first macro successfully using a Single column Excel spreadsheet that is creating a PDF file from web capture with a filename that matches the value. (Cell 1, column 1 value = 12345678 creates PDF document 12345678.pdf) and places it in an already existing local output folder location. (Folder path = C:\Users\HP\Documents\Script Output Documents\Macro1)

The second macro uses a subset of the first Excel list that creates a similar PDF file from web capture and drops the file to Folder path = (Folder path = C:\Users\HP\Documents\Script Output Documents\Macro2) with naming convention:(Cell 1, column 1 value = 12345678 creates PDF document 12345678AL.pdf)

The third is the most simple of the three macros and creates a single PDF document and drops the file to Folder path = C:\Users\HP\Documents\Script Output Documents\Macro3) with naming convention: WebReport.pdf)

I am hoping that the Macro gurus can shed some light on the best way they would go about doing the following two system tasks:

1) I need help with creating a directory location for each of the values listed in that initial Excel spreadsheet and then subsequently drop the created pdf into that folder of the same name.(create folder 12345678 and then drop the pdf that gets created by macro 1 into that folder. Repeat for each cell of spreadsheet.
How is that best accomplished? It can be a step prior to running the first macro or would prefer to add it into that macro if possible.

2)Once each new folder is created and the pdf is dropped into it from Macro 1, I need to copy the pdf from Macro 3 into each of the new folders created.

Goal: There will be a new folder created and named for each excel value available to drop associated files created by Macro1 and (Macro2 if applicable). Then copy the file from Macro3 to all created folders.

I am familiar with the basic functionality of MacroScheduler, but having troubles with piecing this part into that process. Any assistance would be GREATLY appreciated.

Sincerely,
Labman

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: 2 folder creation and file copy process questions from a newbie

Post by Marcus Tettmar » Mon Oct 15, 2018 3:33 pm

When you say "dropped" do you mean copied or moved? You can use CopyFile and MoveFile? Assume you have the source - sounds like you're creating it, so just use MoveFile or CopyFile to move/copy it to the destination. To create folders use the CreateDir command.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Jlomers
Newbie
Posts: 7
Joined: Tue Feb 06, 2018 4:11 pm

Re: 2 folder creation and file copy process questions from a newbie

Post by Jlomers » Tue Oct 16, 2018 9:49 pm

Are you trying to create a 4th system that moves all the files created in the first 3 to the setup you describe,

Or do you want to add into the system 1 the creation of the folder and 2 and 3 the save into the folder created by 1?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts