Skip to main content
Community site session details

Community site session details

Session Id : FyJ0KeHt6Mm7+cU8lp9XXX
Power Automate - Power Automate Desktop
Unanswered

Opening multiple files within Power Automate Desktop via VBScript

Like (0) ShareShare
ReportReport
Posted on 13 Feb 2024 22:01:12 by 34

Hello,

I am creating a Microsoft PAD flow using VBScript to filter and move data from one document to another. Am I able to open multiple files within the VBScript and have it paste into that document? 

 

For instance, with the script below, I need the filtered data from the %FilePathBrandAging% variable to paste into another document. I have the below VBScript written so far. How would I add additional documents to the script, manipulate data on those documents, and copy into a final template?

 

Set xlApp=Createobject("Excel.Application")
Set xlWbk=xlApp.Workbooks.Open("%FilePathBrandAging%")
xlApp.Visible=true
Set xlWksht = xlWbk.ActiveSheet
Set xlWksht = xlWbk.Worksheets(1)
xlWksht.Range("D:D").AutoFilter %FilterColumn%, Array("%FilterCR%","%FilterDR%"), 7
xlWksht.Range("A:U").Copy
Set xlWksht = xlWbk.Worksheets(2)
xlWksht.Range("A1").PasteSpecial
Set xlWksht = xlWbk.Worksheets(1)
xlWksht.Range("D:D").AutoFilter %FilterColumn%, "%FilterPMT%"
xlWksht.Range("A:U").Copy
Set xlWksht = xlWbk.Worksheets(3)
xlWksht.Range("A1").PasteSpecial
Set xlWksht = xlWbk.Worksheets(1)
xlWksht.Range("D:D").AutoFilter %FilterColumn%, "%FilterSLS%"
xlWksht.Range("A:S").Copy
Set xlWksht = xlWbk.Worksheets(4)
xlWksht.Range("A1").PasteSpecial
Set xlWksht = xlWbk.ActiveSheet
Set xlWksht = xlWbk.Worksheets(1)
xlWksht.Range("D:D").AutoFilter %FilterColumn%, Array("%FilterCR%","%FilterDR%", "%FilterPMT%", "%FilterSLS%"), 7

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2