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
Unanswered

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…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard