Click here to Skip to main content
15,905,963 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to put a comment in a cell.
Both data came from my database.
I'm using sb.Append and html tables to generate report to excel.
Is this possible?
Thanks in advance.
Posted

1 solution

Two ways you can achieve it. First solution is manual operation as:
Take your simple html file and open it in Excel.
Add a comment to a cell.
Save it, preserving the html format.

Second solution is through code as:
HTML
<html xmlns:v="urn:schemas-microsoft-com:vml">
    xmlns:office="urn:schemas-microsoft-com:office:office"
    xmlns:excel="urn:schemas-microsoft-com:office:excel"
    xmlns="http://www.w3.org/TR/REC-html40">
<body>

    <div style="mso-element:comment-list">
        <div style="mso-element:comment">
         <div v:shape="_comment1">
                This is first comment
            </div>
            <div v:shape="_comment2">
                This is another comment
            </div>
        </div>
    </div>
</body>
</html>
 
Share this answer
 
Comments
YuMih 12-Feb-12 23:01pm    
i cant do the first one as this is a report generation.
i'll try the second one though, i think i've seen this code earlier and tried it.
but i'll try it again. i'll let you know if it works. thanks.
YuMih 12-Feb-12 23:04pm    
not working -.-

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900