Have a Question?
Table of Contents
< All Topics

Error with a Period in Messaging
Attachment File Name

One user recently noticed that their Excel-based final reports automatically emailed by LIMS Messaging were failing for just one of their new customers with the error “Could not send with MsgExcel …” Checking the designated folder where Messaging creates files before attaching to emails showed the expected file names for the customer’s reports. However, unlike all other files in the folder, this customer’s files had no extension (e.g. xlsx, pdf, etc.).

The user had entered the following expression for the attachment file names on the Messaging tab of the System Configuration screen:

Customer.Name & “ ” & Batch & Format(Now(), “-yymmddhhmm”)

Seeing no problem with this expression, we attempted to duplicate the error in Messaging. Assuming a customer name of “Wind River Labs Inc.” and a batch number of 987, the expression above yields the following example file name, which triggered the error:

Wind River Labs Inc. 987-1507130845

You can manually create an Excel file with the above name, so what’s the problem? When creating a report with an Excel template, Messaging programmatically tells Excel to save the workbook with the file name resulting from the expression and lets Excel apply the proper file extension (e.g. xls, xlsx, etc.). In this case, we learned that when the file name already includes a period (.), regardless of where the period occurs in the file name, Excel omits the file extension.

Since the culprit period originates in the customer name, we solved the problem with an updated attachments file name expression that strips any periods in the customer name:

Replace(Customer.Name, “.”, “”) & “ ” & Batch & Format(Now(), “-yymmddhhmm”)

Table of Contents