Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VfpxWorkBookXlsx by Greg Green
Message
 
 
To
29/08/2018 17:55:10
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
01661763
Message ID:
01661782
Views:
453
>Take a look at the Demo() method in the class. It has many examples. But you would apply the word wrap to a cell after creating the workbook (or reading in an existing workbook). You first create a style of format. To the style you add the word wrap, font, size, border, etc. Then you apply the style to cells. Read the section in the documentation for styles.

Hi again,

I have a question and a comment.

Question.
I use method SaveTabletoWorkbook() to convert an open cursor to the Excel spreadsheet. I checked the return object for values (loReturn.sheet and loReturn.Workbook) and they both are 0 (zero). So, I assume that that method SaveTabletoWorkbook() closes the file. Therefore, in order for me to apply WordWrap to some cells, I need to re-open the file and the the handles for the method SetCellWordWrap(). How do you open an excel file and get the Id to workbook and Id to sheet in workbook?

UPDATE: I do see in the docs the method OpenXlsxWorkbook() which returns Id for workbook. I also find the method GetWorkbookSheets() which should return the Id to the work book. I will try these.

UPDATE2: The method OpenXlsxWorkbook() returns 0 (zero). This is how I call it:
nId = loExcel.OpenXlsxWorkbook( cExcelFileName )   && the cExcelFileName includes the path to the existing file
What am I doing wrong here?


Comment
It would nice (I know, just wishful thinking :)) if the method SaveTabletoWorkbook() would accept another parameter (optional), array or an object. And in this "array", the developer could define the styles for each column in the Excel( e.g. WordWrap). This way, the method SaveTabletoWorkbook() would use this "array" and apply the styles just as it creates the spreadsheet.

Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform