Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I see PDF comments in Excel insert object LHuss Excel Discussion (Misc queries) 0 April 15th 10 06:34 PM
plot graph from multiple worksheet as embedded chart object on every worksheet [email protected] Charts and Charting in Excel 3 August 24th 06 07:26 PM
plot graph from multiple worksheet as embedded chart object on every worksheet [email protected] Excel Discussion (Misc queries) 2 August 24th 06 05:26 PM
plot graph from multiple worksheet as embedded chart object on every worksheet [email protected] Excel Worksheet Functions 2 August 24th 06 05:26 PM
plot graph from multiple worksheet as embedded chart object on every worksheet jeftiong New Users to Excel 0 August 23rd 06 01:50 PM


All times are GMT +1. The time now is 01:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"