My vba script in myMacro.xls Workbooks.Open
Method work well as below,
Workbooks.Open Filename:="D:ExcelMacroProjmyTest.xls", ReadOnly:=True
But when I try to change the Filename
value to a new path as below, but all my practices didn't work. Show Run time error 1004.
Workbooks.Open Filename:="myTest.xls", ReadOnly:=True
or
Workbooks.Open Filename:="./myTest.xls", ReadOnly:=True
or
Workbooks.Open Filename:=".myTest.xls", ReadOnly:=True
Actually myMacro.xls and myTest.xls was placed in the same folder. That's why I want to change to a flexible folder directory.
how could I fix this issue? Appreciated for your read and reply.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…