Unable to run excel macro after changing file name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

After changing the filename in an excel macro, receiving Error number 5 -
Invalid procedure call or argument when users with excel 2000 run the macro.
Users with excel 2003 are not having this issue
 
Here is the macro code:

Dim Message, Title, Default, OperID, Response
Message = "Enter the PeopleSoft User ID of the person who ran the
report:"
Title = "Format Daily Hire Report: PeopleSoft User ID"
OperID = InputBox(Message, Title)
fName =
"\\OMACSAN01\PEOPLESOFT\Report_Output\user\Reports\DAILY-REPORT-" & OperID &
".CSV"

With Application.FileSearch
.NewSearch
.LookIn = "\\OMACSAN01\PEOPLESOFT\Report_Output\user\Reports"
.Filename = fName
Workbooks.Open Filename:=fName

After hitting 'Workbooks.Open Filename:=fName' is when we receive the error.
Thanks for your help.
 
Back
Top