Hi,
I'm using a report generating program (Crystal Reports) to automatically generate and place on a network drive five Excel workbooks once per week. The reporting application has the ability to email the workbooks to recipients but the problem is it is not smart enough to not email out a workbook when the workbook is empty.
I'm thinking a two step process to get around this. First I'd write some kind of program that would remove all workbooks in the directory that are empty. Second I'd write a little dos batch program that would email the remaining files in the directory.
My issue is with the first part. Is there a way to write an Excel macro that could can be executed from the DOS command line or from Start | Run that can tell if a workbook is empty and delete it if it is. I'm thinking this macro would open the workbook - check the contents of cell A1 and if it's empty close the workbook and delete it. If cell A1 is not empty close the workbook and go to the next workbook.
Second thing I thought of was doing something in VBA but isn't VBA actually the Excel macro language (that shows my experience level)?
Lastly I heard is that I can probably do something in Perl (no experience there either).
Point of this is to automate the process completely so whatever macro is run has to be able to be executed via Windows Scheduler or executeve via our Crystal Reports scheduler (it has the ability to execute files outside of Crystal Reports).
Hoping I can do something with Excel.
Thanks in advance for any input.
I'm using a report generating program (Crystal Reports) to automatically generate and place on a network drive five Excel workbooks once per week. The reporting application has the ability to email the workbooks to recipients but the problem is it is not smart enough to not email out a workbook when the workbook is empty.
I'm thinking a two step process to get around this. First I'd write some kind of program that would remove all workbooks in the directory that are empty. Second I'd write a little dos batch program that would email the remaining files in the directory.
My issue is with the first part. Is there a way to write an Excel macro that could can be executed from the DOS command line or from Start | Run that can tell if a workbook is empty and delete it if it is. I'm thinking this macro would open the workbook - check the contents of cell A1 and if it's empty close the workbook and delete it. If cell A1 is not empty close the workbook and go to the next workbook.
Second thing I thought of was doing something in VBA but isn't VBA actually the Excel macro language (that shows my experience level)?
Lastly I heard is that I can probably do something in Perl (no experience there either).
Point of this is to automate the process completely so whatever macro is run has to be able to be executed via Windows Scheduler or executeve via our Crystal Reports scheduler (it has the ability to execute files outside of Crystal Reports).
Hoping I can do something with Excel.
Thanks in advance for any input.