Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VfpxWorkBookXlsx by Greg Green
Message
 
 
To
29/08/2018 19:34:23
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
01661763
Message ID:
01661773
Views:
51
>>>>Hi,
>>>>
>>>>Anybody knows how to apply the method SetCellWordWrap() to set a column of the resulting Excel spreadsheet to Word Wrap?
>>>>
>>>>My code that converts an open cursor to the Excel is as follows:
>>>>
>>>>
>>>>*-- The cursor is which is converted to Excel is open at this point. Then simply calling the method 
>>>>*-- SaveTabletoWorkbook() (as seen below) creates excel.
>>>>loExcel.SaveTabletoWorkbook(lcCursorName, cExcelFileName, .T., .T., tcWorkSheetName)
>>>>
>>>>
>>>>The documentation refers to method SetCellWordWrap() which is supposed to set a cell to word-wrap. But how do I apply it, I am not clear.
>>>
>>>It's been years since the last time I had excel on my machine, so off the top of my head... shouldn't all formatting methods accept ranges as parameters? Or, alternatively, wouldn't any range have this method?
>>>
>>>In the latter case
>>>
>>>loRange=oWorkbook.range("C")
>>>loRange.SetCellWordWrap()
>>>
>>>with perhaps .t. as parameter to set it on or .f. for off.
>>>
>>>>UPDATE: Is it against the etiquette of UT to address this message to Greg Green (since he may not be online on regular basis)?
>>>
>>>With the easily offended out of the picture, it's up to you. You may wait for him to see the message.
>>
>>1. On your first suggestion. The method SetCellWordWrap accepts 5 parameters (LPARAMETERS tnWB, tnSheet, tnCellRow, tnCellCol, tlWordWrap). My code (above) creates the Excel file. But I have no idea how to get the Id to the work book and Id to the sheet in workbook (first 2 parameters). The last parameter is pretty obvious, .T.
>>
>>2. I will wait a day or two before I address the message directly to Greg.
>
>It's been a while since I last looked at it, but I think after you create the file you open it using class methods, which gives you a reference to the workbook. You then get a reference to a sheet within that workbook by using another method. As I recall it's fairly well documented, either in the PEMs reference or in various examples in the docs.
>
>AFAIK I don't think Greg gets bent out of shape if you create a new thread directly to him, I think I've done that in the past. Does this forum have a global feature that sends you an e-mail if a forum message is sent to you? If there is and he's got that set up then it would probably come to his attention quicker if you address it to him.

He replied.

Yes, I looked at the docs and the method SaveTabletoWorkbook() and I see that it returns the values I would need to pass to the method setcellwordwrap(). I also looked at the demo() method (that Greg Green mentioned) and it gives me some ideas. Hopefully I can put these ideas to work.

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
Reply
Map
View

Click here to load this message in the networking platform