Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rich Text data using Excel and SQL

Status
Not open for further replies.

chemimpex

IS-IT--Management
Feb 23, 2006
18
US
I have rich text data stored in sql using the actual RTF strings. I want to edit this data in excel.

How can i get this data using the string from SQL into an excel cell keeping the formatting intact?

Once that is done, how can I get this string back to SQL, meaning how can I get the rtf string from an excel cell?

Currently i do this using a Rich text box and word which works good for small amounts of data but when there are 20000 rows in excel, this take forever. I want to speed up the process by eliminating word and RTF box and using the clipboard in VBA.
I see that clipboard has settext and gettext functions which would work great but they don't seem to work in VBA.
What references do i need to add to vba macro for clipboard and what objects do I need to define.

I am trying
Temp1 = Clipboard.GetText(vbCFRTF)
which returns error saying object required.

I also want to do
clipboard.settext STR
where str is the string retrieved from the database so I can paste this in excel and edit it.
Is this possible? Thanks in advance for your time.

If anything can go wrong, it WILL.
 


Hi,

When you say, "I have rich text data stored in sql..." that does not make sense.

SQL {Structured Query Language} is CODE for accessing data from data sources.

Did you mean that you have data stored in an SQL Server database or something else?

Skip,

[glasses] When a wee mystic is on the loose..
It's a Small Medium at Large! [tongue]
 
Yeah sorry, I meant the strings are stored in MS SQL server.

If anything can go wrong, it WILL.
 




I'm not aware of a way to get formatting information out of a data source.

However, that's not to say it can't be done. If I were to TRY to get such info, I'd use ADO Data Objects and I'd browse the recorset object to see if there were a property that contained formatting.

But not having such a source, I have theory alone as a guide.

Skip,

[glasses] When a wee mystic is on the loose..
It's a Small Medium at Large! [tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top