Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Memo fields and Excel
Message
From
20/05/2002 17:13:43
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00658848
Message ID:
00659120
Views:
29
Kevin - your the man. Wouldn't you know that rather than going thru each record in the table I just used the first record in the table to test my logic and it had a carriage return in it. All the other memo fields in the table did not have them. Once I removed the carriage return it works great.

The program I am using this in is a program I wrote for Gayle and she says MANY THANKS. You just made Gayle's day.

Hope everything is going great for you. Thanks
Gaylen



>Hey Gaylen,
>
>How have you been? I tried your code and didn't get the results you said you were getting (I didn't get the boxes around the text). I then went into my memo field and hit enter before and after the text (put carriage returns at beg. and end of the field). After re-running the code, the boxes then appeared around my text in the excel sheet. If in fact those are carriage returns in you memo field, you could strip them out before putting them on your excel sheet.
>Hope this helps.
>Kevin
>
>>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