Formatting Question

Laurence -

I hope the holidays find you well.

I have a question of formatting times. I have a spreadsheet with 20 columns, column number 3 and column number 4 are time formats (mm:ss) like 02:20 (for 2 minutes, 20 seconds).

When I run a stored procedure through analyzer and copy and paste my results in my spreadsheets the spreadsheets treats those columns as times. When I do an export through ASPOSE.Excel those columns come out as text fields and then I can not do any calculations on them.

Do you / Could you help me on how I should format those columns so they will stay time formats instead of text when they are imported.

Any help you can give will be greatly appreciated.

Thanks
SGT

Hi Steven,

Could you email me your spreadsheet with those time columns? And please tell me how you export them. I will check this issue right now.

@Steven_Tidwell,
Aspose.Excel is discontinued and no more under active development now. It is replaced by Aspose.Cells that has more features as compared to its predecessor along with the support to all the latest features in different versions of MS Excel. This new product also supports formatting cells for handling date/time data as shown in the following Aspose.Cells C# example.

// Instantiating a Workbook object
Workbook workbook = new Workbook();

// Obtaining the reference of the newly added worksheet by passing its sheet index
Worksheet worksheet = workbook.Worksheets[0];

// Adding the current system date to "A1" cell
worksheet.Cells["A1"].PutValue(DateTime.Now);

// Getting the style of A1 cell
Style style = worksheet.Cells["A1"].GetStyle();

// Setting the custom display format to show date as "d-mmm-yy"
style.Custom = "d-mmm-yy";

// Applying the style to A1 cell
worksheet.Cells["A1"].SetStyle(style);
workbook.Save("output.xlsx");

You may visit the following Aspose Cells Documentation for more information on Cells Formatting:
Data Formatting

Download the latest version here for the trial version:
Aspose.Cells for .NET (Latest Version)

Here is ready to run solution that can be used to test the product features without writing any code.