Click here to Skip to main content
15,895,256 members
Home / Discussions / C#
   

C#

 
AnswerCrosspost warning! Pin
Peter_in_27809-Nov-10 16:35
professionalPeter_in_27809-Nov-10 16:35 
QuestionPing multiple IP adresses Pin
peropata9-Nov-10 9:36
peropata9-Nov-10 9:36 
AnswerRe: Ping multiple IP adresses Pin
Luc Pattyn9-Nov-10 10:08
sitebuilderLuc Pattyn9-Nov-10 10:08 
GeneralRe: Ping multiple IP adresses Pin
peropata9-Nov-10 11:18
peropata9-Nov-10 11:18 
GeneralRe: Ping multiple IP adresses Pin
Luc Pattyn9-Nov-10 11:24
sitebuilderLuc Pattyn9-Nov-10 11:24 
GeneralRe: Ping multiple IP adresses Pin
peropata9-Nov-10 11:49
peropata9-Nov-10 11:49 
GeneralRe: Ping multiple IP adresses Pin
Mycroft Holmes9-Nov-10 12:10
professionalMycroft Holmes9-Nov-10 12:10 
QuestionGenerate Word Report fails with System.Runtime.InteropServices.COMException (0x800A1066): Command Failed [modified] Pin
tschueggi9-Nov-10 3:08
tschueggi9-Nov-10 3:08 
Hey Guys

In our company we switched from Office 2000 to 2010 a couple of days ago. Now we have a very strange Problem. About 6 different applications could create Word reports (data sheets for heat plate exchangers) under Office 2000. Now under 2010 sometimes we can generate the Word report (on the first start after logon), then after the 2nd or 3rd it no longer works, Word opens but the document is blank. The error we see in those applications is "OLE Automation ERROR".

To trace the problem i wrote the following c# application:

_Application wordApplication = new Microsoft.Office.Interop.Word.Application();
     var f = new FileInfo(txtPath.Text);

     object o_null = Missing.Value;
     object o_true = "";
     object o_false = "";
     object o_filePath = @"" + f.FullName;
         Document doc = wordApplication.Documents.Open(ref o_filePath, ref o_null, ref o_null, ref o_null, ref o_null, ref o_null, ref o_null, ref o_null, ref o_null, ref o_null, ref o_null, ref o_null);
         String text = doc.Content.Text;


Thats the relevant part of the code, there is just some gui-code more, nothing special. Of course the Microsoft.Office.Interop.Word-Com object is referenced.
On the first launch of this programm, reading the content of a word document works perfectly. The second time i hit the open-document button in this c#-app i get the following error:

System.Runtime.InteropServices.COMException (0x800A1066): Command failed
at Microsoft.Office.Interop.Word.Documents.Open(Object& FileName, Object& ConfirmConversions, Object& ReadOnly, Object& AddToRecentFiles, Object& PasswordDocument, Object& PasswordTemplate, Object& Revert, Object& WritePasswordDocument, Object& WritePasswordTemplate, Object& Format, Object& Encoding, Object& Visible, Object& OpenAndRepair, Object& DocumentDirection, Object& NoEncodingDialog, Object& XMLTransform)

To solve this Problem i tried almost everything:
Different users (all with local admin accounts)
Different computers (newly installed windows xp sp3)
reinstalled Office 2010 /repaired Office 2010
New domain user accounts
Changed the access rights in DCOM-Word-Object to local administrator


The weird thing is, after logging in the first time, generating one word report works, then the second time it sometimes works but on the third or fourth and so on time we get the error above.
I know, this problem lies probably more in the windows system and not the actual c# application (the other applications aren't written in c# but show the same behaviour), but i thought maybe someone of you could have an idea.
I would be really happy if anybody could help me solving this problem. It don't know anything more I could do!

regards from switzerland

Urs

modified on Tuesday, November 9, 2010 9:14 AM

AnswerRe: Generate Word Report fails with System.Runtime.InteropServices.COMException (0x800A1066): Command Failed Pin
Luc Pattyn9-Nov-10 4:08
sitebuilderLuc Pattyn9-Nov-10 4:08 
GeneralRe: Generate Word Report fails with System.Runtime.InteropServices.COMException (0x800A1066): Command Failed Pin
tschueggi9-Nov-10 5:30
tschueggi9-Nov-10 5:30 
GeneralRe: Generate Word Report fails with System.Runtime.InteropServices.COMException (0x800A1066): Command Failed Pin
Luc Pattyn9-Nov-10 6:29
sitebuilderLuc Pattyn9-Nov-10 6:29 
GeneralRe: Generate Word Report fails with System.Runtime.InteropServices.COMException (0x800A1066): Command Failed Pin
tschueggi10-Nov-10 2:13
tschueggi10-Nov-10 2:13 
AnswerRe: Generate Word Report fails with System.Runtime.InteropServices.COMException (0x800A1066): Command Failed Pin
_Erik_10-Nov-10 1:58
_Erik_10-Nov-10 1:58 
GeneralRe: Generate Word Report fails with System.Runtime.InteropServices.COMException (0x800A1066): Command Failed Pin
tschueggi10-Nov-10 2:20
tschueggi10-Nov-10 2:20 
GeneralRe: Generate Word Report fails with System.Runtime.InteropServices.COMException (0x800A1066): Command Failed Pin
_Erik_10-Nov-10 2:52
_Erik_10-Nov-10 2:52 
GeneralRe: Generate Word Report fails with System.Runtime.InteropServices.COMException (0x800A1066): Command Failed Pin
tschueggi10-Nov-10 4:42
tschueggi10-Nov-10 4:42 
GeneralRe: Generate Word Report fails with System.Runtime.InteropServices.COMException (0x800A1066): Command Failed Pin
_Erik_10-Nov-10 7:12
_Erik_10-Nov-10 7:12 
QuestionHelp with serial data display Pin
turbosupramk39-Nov-10 1:58
turbosupramk39-Nov-10 1:58 
AnswerRe: Help with serial data display Pin
OriginalGriff9-Nov-10 2:17
mveOriginalGriff9-Nov-10 2:17 
GeneralRe: Help with serial data display Pin
turbosupramk39-Nov-10 2:26
turbosupramk39-Nov-10 2:26 
GeneralRe: Help with serial data display Pin
OriginalGriff9-Nov-10 4:21
mveOriginalGriff9-Nov-10 4:21 
GeneralRe: Help with serial data display Pin
turbosupramk39-Nov-10 6:38
turbosupramk39-Nov-10 6:38 
GeneralRe: Help with serial data display Pin
OriginalGriff9-Nov-10 8:21
mveOriginalGriff9-Nov-10 8:21 
GeneralRe: Help with serial data display Pin
ColinBurnell9-Nov-10 21:41
professionalColinBurnell9-Nov-10 21:41 
GeneralRe: Help with serial data display Pin
turbosupramk310-Nov-10 2:23
turbosupramk310-Nov-10 2:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.