Q
Q
Hello
I have a macro from Excel 2003, and it works fine in Excel 2003. The macro
processes some data and saves the output Excel file to a folder. In the
macro, I have a variable that stores the output path. The macro uses the
value in the output path variable to save the Excel file.
For some reason, when running this macro in Excel 2007, the output path
variable is blank! The variable declaration is in the middle of the
subroutine in the macro and the variable assignment to the output path is
done right afterward.
I did a search on the project, thinking perhaps elsewhere in the code that
causes the output path to be blank, but nowhere else uses this variable but
this subroutine.
Later, when I moved this variable declaration and assignment to near the
beginning of the subroutine, it works fine.
The location of variable declaration in Excel 2007 matters?
Thanks,
Q
I have a macro from Excel 2003, and it works fine in Excel 2003. The macro
processes some data and saves the output Excel file to a folder. In the
macro, I have a variable that stores the output path. The macro uses the
value in the output path variable to save the Excel file.
For some reason, when running this macro in Excel 2007, the output path
variable is blank! The variable declaration is in the middle of the
subroutine in the macro and the variable assignment to the output path is
done right afterward.
I did a search on the project, thinking perhaps elsewhere in the code that
causes the output path to be blank, but nowhere else uses this variable but
this subroutine.
Later, when I moved this variable declaration and assignment to near the
beginning of the subroutine, it works fine.
The location of variable declaration in Excel 2007 matters?
Thanks,
Q