Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Memo fields and Excel
Message
From
21/05/2002 22:57:49
 
 
To
21/05/2002 16:37:54
Jonathan Cochran
Alion Science and Technology
Maryland, United States
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00658848
Message ID:
00659712
Views:
37
Johnathan - My needs are for the memo field to not have any line feeds or carriage returns as it is ultimately used as input used by a magazine publishing program. Therefore I had to change the code.

Thanks again



>It sounds like they are working the same way. Leaving the CHR(10) will put carriage returns in the cell, preserving how the data is entered. I guess it depends on your needs as to whether you leave the carriage returns in or take them out.
>
>>Excel 2000 - Using Chr(10) eliminates the two boxes before and after the text but it widens the row to about 3 rows in height and centers the text in
>>the row. Using " " allows the memo text to display in one cell, one row in height.
>>
>>
>>Thanks again for the tip. Must be the difference between 97 and 2000.
>>
>>Gaylen
>>
>>
>>
>>
>>
>>>Really? It works fine on my machine. What version of Excel are you using? I'm using Excel 97.
>>>
>>>>Jonathan
>>>>
>>>>I had to change your code to the following.
>>>>
>>>>
>>>>.range("G2").value = STRTRAN( mytable.ts_memo, CHR(13) + CHR(10), " " )
>>>>
>>>>
>>>>The chr(10) was also causing a problem with the ole automation. Using " " it works great.
>>>>
>>>>Thanks
>>>>Gaylen
>>>>
>>>>
>>>>>If you want to keep carriage returns, you can:
>>>>>
>>>>>
>>>>>.range("G2").value = STRTRAN( mytable.ts_memo, CHR(13) + CHR(10), CHR(10) )
>>>>>
>>>>>
>>>>>>I have an application where I am letting the user pick the fields to use for an excel spreadsheet. I am using the copy to command to create the xls speadsheet. The memo will not transfer over to the spreadsheet using this method so I want to add the memo field in the last column of the spreadsheet using ole automation as follow. In trying to test the process I used the following code assuming the user had selected 7 fields including the memo field and I want the memo field to appear in column G.
>>>>>>
>>>>>>
>>>>>>    olapp = CREATEOBJECT("Excel.application")
>>>>>>
>>>>>>	SELECT mytable
>>>>>>	   WITH olapp
>>>>>>	   .workbooks.open('C:\myxlsfile')
>>>>>>	   .range("G2").rows.autofit
>>>>>>	   .range("G2").value = mytable.ts_memo
>>>>>>	   .range("G2").wraptext =.t.
>>>>>>	   .Visible = .T.
>>>>>>	   endwith
>>>>>>
>>>>>>
>>>>>>
>>>>>>I can get the memo field to display in the spreadsheet. However its appearance is as follows:
>>>>>>
>>>>>>The text is diplayed with a small square box displayed before the text and a square box displayed after the end of the text. The text appears to be contained in a container and appears to be centered in the container and thus the row spacing is very large. The cell is formatted as a general cell, changing it to text does not change it. I have commented out the autofit and wraptext command and run the routine several times and they appear to have no affect on the way the memo field is displayed, that is the appearance of the square boxes and the fact it appears to be in a container persists.
>>>>>>
>>>>>>
>>>>>>Any one have any suggestions.
>>>>>>
>>>>>>
>>>>>>Gaylen
Previous
Reply
Map
View

Click here to load this message in the networking platform