Chart generation and the emailing can be triggered by clicking on a circle Sub Oval_SMTP_Click() labeled “SMTP”. Chart_Source Otherwise the Chart_Email mailing is carried End Sub out by a periodic script which will be presented in following sections. The Excel is updated in case user has changed the number of Sub Chart_Source() intervals. The value of Charts(1).SetSourceData [chart_range] is Source:=range(range("chart_range").Value) computed by Excel End Sub formulas as a function of the number of intervals. The folder name for stocking the charts is computed in the Excel worksheet’s [chart_path] cell. This is a folder in Sub Chart_Email() the same location as the Excel file Dim As String with the same Dim As = range("chart_path").Value name as the Excel Set = file but suffixed by text. We If Len(Dir(chart_path, vbDirectory)) = 0 Then “_Chart” MkDir verify if the folder End If exists. If it does .Calculate not, we create it. Charts(1).Export & "\" & .Value We refresh the SMTP (chart_path & "\" & .Value) value of the filename of the End Sub chart (as it contains the current time) by recalculating cell [chart_name]. The PNG file is created by the Export
Sub Oval_SMTP_Click() Chart_Source Chart_Email End Sub Chart generation and the emailing can be triggered by clicking on a circle labeled “SMTP”. Otherwise the mailing is carried out by a periodic script which will be presented in following sections. Sub Chart_Source() Charts(1).SetSourceData Source:=range(range("chart_range").Value) End Sub The Excel is updated in case user has changed the number of intervals. The value of [chart_range] is computed by Excel formulas as a function of the number of intervals. Sub Chart_Email() Dim As String Dim As = range("chart_path").Value Set = If Len(Dir(chart_path, vbDirectory)) = 0 Then MkDir End If .Calculate Charts(1).Export & "\" & .Value SMTP (chart_path & "\" & .Value) End Sub The folder name for stocking the charts is computed in the Excel worksheet’s [chart_path] cell. This is a folder in the same location as the Excel file with the same name as the Excel file but suffixed by “_Chart” text. We verify if the folder exists. If it does not, we create it. We refresh the value of the filename of the chart (as it contains the current time) by recalculating cell [chart_name]. The PNG file is created by the Export
index7.docx