web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to use Variable as...
Power Automate
Suggested Answer

How to use Variable as File Path to Open Excel File in VB Script

(0) ShareShare
ReportReport
Posted on by 12
Hello,
 
I am trying to Open downloaded Excel file with Variable name and remove duplicate. In Variable value file path shown, but it is not considered in vbscript.
Can Anyone please help me.
 
Tried with Below. Want to use Input_Master_File variable to open workbook.
 
 
 

Set objExcel=Createobject("Excel.Application")

Set objwbk=objExcel.Workbooks.Open("Input_Master_Files")

Set objsht = objwbk.worksheets("PO Input")

objExcel.visible=True

objsht.UsedRange.RemoveDuplicates 1,1

objwbk.Save

objwbk.Close

objExcel.Quit
 
I have the same question (0)
  • Suggested answer
    VishnuReddy1997 Profile Picture
    2,656 Super User 2025 Season 2 on at
     
    You use the variable as path in VBscript like this as shown in image.
     
     
     
    I think in you case you have list files so use %Input_Master_Files[0]%,if first is the required file path in the list.
     
     
     
    (Note:- if you got your solution you can mark as solution and gives kudos)
     
    Thanks & Regards
    Vishnu Reddy

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 375 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 269 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 127 Most Valuable Professional

Last 30 days Overall leaderboard