Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Memo fields and Excel
Message
From
21/05/2002 12:57:30
Jonathan Cochran
Alion Science and Technology
Maryland, United States
 
 
To
20/05/2002 23:26:10
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00658848
Message ID:
00659478
Views:
26
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
Next
Reply
Map
View

Click here to load this message in the networking platform