How to save a copy of an inactive worksheet - Excel 2003 vba -


we have piece of software allows user run report. template report excel workbook exists on network drive. steps are:

the user clicks "generate report" software opens template, populates data, , closes template, saving in specific directory. done "silently", is, sheet never visible user.

my goal have vba module execute while sheet open, save additional copy of workbook in separate directory. successful 1 line of code doesn't seem want run:

thisworkbook.saveas (filename) 

(where "filename" string containing correct directory. reason not save copy of workbook expect. if open copy made program , run code works fine, during initial copy when sheet not active saveas doesn't anything. code in module called beforesave event.

any thoughts why isn't being run?

do know if beforesave event being triggered? write temp file c drive or sure event firing.

open "c:\eventcheck.txt" append #1 print #1, "event fired" close #1 thisworkbook.saveas (filename) 

Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -