在任何PATH上执行prgram

我正在尝试使用excel执行程序。 但它只适用于我的电脑。 有多个用户使用不同的计算机。 有没有一种方法让python在某人的电脑上search文件,并将该path保存为下面显示的xlspath代码。 我尝试使用shutil但我收到了我自己的目录的权限被拒绝的错误消息。 我正在寻找的文件是Ten Year Load Forecasts 2017-2026.xlsm 。 有3个驱动器: F:\C:\I:\ 。 另外,如果用户将excel表单保存到多个区域,它如何区分需要读取的文件。

 xlApp = win32com.client.DispatchEx('Excel.Application') # Running Excel xlsPath = os.path.expanduser('I:\TPGeneral\Ten Year Load Forecasts 2017-2026.xlsm')# Reading xlsm file wb = xlApp.Workbooks.Open(Filename=xlsPath) # Opening file xlApp.Run('csvfile2')# Running macro---- csvfile2 is the macro name. It is under the "csv" module in the VBA editor wb.Save() xlApp.Quit()