Knowledge Base

Values from Excel worksheet do not appear in NiceLabel. The database variables are empty or not formatted properly

Problem

When you connect an Excel worksheet to your solution, sometimes data from the worksheet does not transfer to the variables on the label. Variables remain empty. Or the data formatting from Excel spreadsheet is not transferred to label variables correctly. This can happen when column in worksheet contains mixed data: some fields are alphanumerical and other numerical.

Microsoft ODBC driver tries to auto-detect the type of data entered in the cells, but sometimes this auto-detection routine fails and the data type is wrongly recognized.

Solution

Workaround 1: (This approach might not provide the required result.) Reformat the cell types in the spreadsheet to Text format.  Do the following:

  1. Make sure that all values in the same column are of the same type.
  2. If that is not possible and you use mixed data, format the column as Text and not General. In the Cells menu, click Format, and select the Text option on the Numbers tab.
  3. Perform the column formatting prior to the actual data entry.
  4. If the data is already entered, you will have to re-format the values using function TEXT (refer to MS Excel help for proper syntax of this function).

Workaround 2: Export the data from your Excel spreadsheet into the text file with tab-separated values. Then import the data into a new spreadsheet as Text format.

  1. Open your Excel spreadsheet.
  2. Select the command Save As in the File menu.
  3. For the file type select Text (Tab delimited) (*.txt).
  4. Save the file.
  5. Close the spreadsheet in Excel.
  6. Open your Tab-delimited text file in Excel.
  7. Follow on-screen instructions on how to import the data from the text file.
  8. Select the field for which you want to change the formatting.
  9. Change the formatting to Text.
  10. Repeat steps 8-9 until all fields have the required formatting.
  11. Select the command Save As in the File menu.
  12. Save the spreadsheet to Microsoft Excel Workbook (*.xls) format.
  13. Use this Excel workbook as your data source for label printing.

Print document   Email document

Feedback

Did this article help you? *