K
KevinGPO
I have a excel problem.
I am writing a VBA macro for a generic Excel template to:
0. Upon first load up, immediately SaveAs (date-timestamp).xls to make a
copy of itself so that the generic template file can be opened by another
automated application.
1. Parse cell B1 for a path to save to. Parse other cells for data to be
used in final filename.
2. Delete all macro code.
3. SaveAs using final filename to path specified in cell B1.
4. Delete old (date-timestamp).xls file.
5. Must terminate Excel application and must not prompt user to save.
I have found that if the path is a network drive then saving takes 10
minutes. However if the path is a local drive then the save is
instantaneous. Then if I copy the file using Windows Explorer then that's
also instantaneous.
I believe Excel SaveAs function is very very slow when saving across a
network. Maybe it sends it out in very tiny packets. I don't know.
So I want to get around this time problem by writing the macro to Save to
local drive and then copy itself using the FileCopy command. However this
doesn't seem possible for #2 "Delete all macro code" & #4 "Delete old
date-timestamp.xls file" to work now.
Do you have any advice/suggestions on how I can get this to work?
I am writing a VBA macro for a generic Excel template to:
0. Upon first load up, immediately SaveAs (date-timestamp).xls to make a
copy of itself so that the generic template file can be opened by another
automated application.
1. Parse cell B1 for a path to save to. Parse other cells for data to be
used in final filename.
2. Delete all macro code.
3. SaveAs using final filename to path specified in cell B1.
4. Delete old (date-timestamp).xls file.
5. Must terminate Excel application and must not prompt user to save.
I have found that if the path is a network drive then saving takes 10
minutes. However if the path is a local drive then the save is
instantaneous. Then if I copy the file using Windows Explorer then that's
also instantaneous.
I believe Excel SaveAs function is very very slow when saving across a
network. Maybe it sends it out in very tiny packets. I don't know.
So I want to get around this time problem by writing the macro to Save to
local drive and then copy itself using the FileCopy command. However this
doesn't seem possible for #2 "Delete all macro code" & #4 "Delete old
date-timestamp.xls file" to work now.
Do you have any advice/suggestions on how I can get this to work?