View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ross Ross is offline
external usenet poster
 
Posts: 152
Default GetObjects chokes on apostrophe.

I'm trying to use GetObjects in an Excel 2007 VB script to get the properties
of mailboxes. This works until I hit a mailbox LegacyDN that has an
apostrophe in it. In the example below Excel gives an "Automation error",
"-2147217375" because of the apostrophe or single quote in the name Pat
O'Conell.

winMgmts:!\\OurServer\root\MicrosoftExchangeV2:Exc hange_Mailbox.LegacyDN='/o=SW/ou=HAM/cn=CENTRAL/cn=Pat
O'Conell',MailboxGUID='{CD2...}',ServerName='OurSe rver',StorageGroupName='st
gr 02',StoreName='mb st - std'

None of the escape characters seem to work: (Pat O''Conell or Pat O\'Conell).

Any hints?