EasyXLS
http://forum.easyxls.com/

EasyXLS for VB 6 Query
http://forum.easyxls.com/viewtopic.php?f=5&t=2281
Page 1 of 1

Author:  opingo [ Fri Jun 09, 2023 9:00 am ]
Post subject:  EasyXLS for VB 6 Query

I have Following Query for EasyXLS for VB 6

Query 1

Dim varValue As Double
varValue = 0.487281089615732

xlsFirstTable.easy_getCell(2, 2).setValue varValue
xlsFirstTable.easy_getCell(2, 2).setFormat ("0.00%")
xlsFirstTable.easy_getCell(2, 2).setDataType ("numeric")

This Shows the Value as "48.73%" but inside the Cell it Shows 48.7281089615732%

How can I shoes inside the Cell as "48.73%"

Query 2

xlsFirstTable.easy_getCell(2, 2).setValue varValue
xlsFirstTable.easy_getCell(2, 2).setFormat ("#0.00")
xlsFirstTable.easy_getCell(2, 2).setDataType ("numeric")

Current Output
varValue = 5.01. This Gives the Output 5.01
varValue = 5.1 This Gives the Output 5.10
varValue = 5 This Gives the Output 5.00
varValue = 0 This Gives the Output 0.00

Output Required
varValue = 5.01. Output 5.01
varValue = 5.1 Output 5.1
varValue = 5 Output 5
varValue = 0 Output 0

I have tried various combination like "#.##" or "#.#0" etc... but it is not working

How this can be done ?


Query 3

I have Cell Range as B2 to E6
I want to give the Border as Outline of Entire Range

How can I give the same in the Range Cell Option ?


Query 4

How can I give AutoFit Entire Column ?

I want to have a Width of 8.43 for Column 1 and Rest all I want to AutoFit.


Thanking You

Bhavesh

Author:  daniela [ Thu Jun 15, 2023 3:52 am ]
Post subject:  Re: EasyXLS for VB 6 Query

Query 1
This is the normal behavior in MS Excel. You may try to create a similar cell in MS Excel interface (without using EasyXLS) and you will get the same behavior.

Query 2
This is also the normal result that you get for "#0.00" number format. If you will not set any number format (default "General"), you will see the numbers that you want.

Query 3
You need to define the border for the cells that defines the range:

Code:
//Top left cell
xlsFirstTable.easy_getCell(RowStart, ColumnStart).setBorderStyles(Border.BORDER_MEDIUM, Border.BORDER_NONE,
                               Border.BORDER_MEDIUM, Border.BORDER_NONE);
//Top cells
for (int col=ColumnStart+1; col <ColumnEnd-1; col ++)
{
   xlsFirstTable.easy_getCell(RowStart, col).setBorderStyles(Border.BORDER_MEDIUM, Border.BORDER_NONE,
                               Border.BORDER_NONE, Border.BORDER_NONE);
}


and similar for the top right cell, left cells, bottom left cell, bottom cells, bottom right cell and right cells.
You may find here the available borders:
https://www.easyxls.com/manual/API_Documentation/EasyXLS/Constants/Border.html

Query 4
Autofit is the default option. You can find more details about autofit and custom column width at the following link:
https://www.easyxls.com/manual/basics/excel-column-width-row-height.html

Page 1 of 1 All times are UTC - 4 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/