Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Comments Member on Worksheet Object
The following C# code:
Excel.Comments tmpComments = m_TargetWorksheet.Comments; foreach(Excel.Comment tmpComment in tmpComments) { tmpComment.Delete(); } Fails with a "Member not found." exception, whether the worksheet has comments in it or not. The same call in VBA works fine whether the workbook has comments or not. I'm using the Office 2002 PIAs for automation. Does anyone know why the Comments member is not recognized? thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Comments Member on Worksheet Object
Hi Matthew,
You may try to use a for statement instead. e.g. Excel.Comments tmpComments = m_TargetWorksheet.Comments; for(int i=1; i<=tmpComments.Count;++i) { tmpComments.Item(i).Delete(); } You may have a try and let me if it does the job for you. Regards, Peter Huang Microsoft Online Partner Support Get Secure! www.microsoft.com/security This posting is provided "as is" with no warranties and confers no rights. -------------------- Message-ID: Date: Fri, 29 Aug 2003 11:06:46 -0400 From: Matthew Wieder User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 X-Accept-Language: en-us, en, he MIME-Version: 1.0 Subject: Comments Member on Worksheet Object Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Newsgroups: microsoft.public.excel.programming NNTP-Posting-Host: 207.106.112.178 Lines: 1 Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl Xref: cpmsftngxa06.phx.gbl microsoft.public.excel.programming:411238 X-Tomcat-NG: microsoft.public.excel.programming The following C# code: Excel.Comments tmpComments = m_TargetWorksheet.Comments; foreach(Excel.Comment tmpComment in tmpComments) { tmpComment.Delete(); } Fails with a "Member not found." exception, whether the worksheet has comments in it or not. The same call in VBA works fine whether the workbook has comments or not. I'm using the Office 2002 PIAs for automation. Does anyone know why the Comments member is not recognized? thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I see PDF comments in Excel insert object | Excel Discussion (Misc queries) | |||
plot graph from multiple worksheet as embedded chart object on every worksheet | Charts and Charting in Excel | |||
plot graph from multiple worksheet as embedded chart object on every worksheet | Excel Discussion (Misc queries) | |||
plot graph from multiple worksheet as embedded chart object on every worksheet | Excel Worksheet Functions | |||
plot graph from multiple worksheet as embedded chart object on every worksheet | New Users to Excel |