none
Exception from HRESULT: 0x800A03EC on SaveCopyAs() RRS feed

  • Question

  • I am using Dotnet framework 4 , VSTO and Office Excel 2007 .

    Excel.Workbook xlWorkbook = null; 
    
    
    
    
     Excel.Range xlRange;
    
    
    
    
    xlWorkbook = ((Excel.Workbook)Globals.ThisAddIn.Application.ActiveWorkbook);
     xlRange = Globals.ThisAddIn.Application.Selection;
    
    
    
    
     if (xlRange.Count > 1) 
    
    
    
    
     { 
    
    
    
    
    xlWorkbook.SaveCopyAs(@"C:\DummyFilename.xlsx");
    }
    
    
    
    

    This snippet works fine and saving  in all scenarios , except  the following

    1) Putting the cursor inside a cell and press save button to execute this snippet

    2) selecting cell content and pressing save button to execute this snippet  

     

    In both this scenarios an exception   is  getting Exception from HRESULT: 0x800A03EC   at  SaveCopyAs() method

     

    But this works fine if we select the cell as a whole or multiple cells



    Monday, March 21, 2011 9:56 AM

All replies