View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Neil Benn Neil Benn is offline
external usenet poster
 
Posts: 1
Default saving excel workbooks

Hello,

I'm working on an app in .NET (using c#) which will open a workbook,
populate the workbook with some data and close it again.

The workbook is a fairly complicated workbook which contains some
custom written macros written using VBA.

However I have a prOblem in that when I open the sheet and try to save
it using SaveCopyAs it only saves the worksheets and loses the VBA codes
(it attempts to open the sheet but says 'file not found' in a msgbox and
repairs the file without the visual studio code!

The error reported is :

System.Runtime.InteropServices.COMException (0x800A03EC): Exception from
HRESULT: 0x800A03EC.
at Excel.WorkbookClass.SaveCopyAs(Object Filename)
at uk.co.catplc.ScreenDataProcessor.ExcelDataLoader.P opulateSheet()
in
c:\inetpub\wwwroot\uk.co.catplc.screendataprocesso r\exceldataloader.asmx.cs:line
82

I've done a hell of a lot of searching to find an anser to this but the
exception code seems to be generic and teh search options bring back
either garbage or docs for Excel 2003.

Could anyone point to the right area?

All help greatly appreciated.

Cheers,

Neil

--
Neil Benn
Senior Automation Informatics Scientist

Cambridge Antibody Technology
Milstein Building Granta Park
Cambridge CB1 6GH UK
Telephone: + 44 (0) 1223 471471
Facsimile + 44 (0) 1223 471472
E-mail:
http://www.cambridgeantibody.com

Cambridge Antibody Technology Limited *
Registered Office:
Milstein Building, Granta Park, Cambridge, CB1 6GH, UK
Registered in England and Wales number 2451177
(* Cambridge Antibody Technology Limited is a member of the
Cambridge Antibody Technology Group of Companies)

Confidentiality Note: This information and any attachments is
confidential and only for use by the individual or entity to whom
it has been sent. Any unauthorised dissemination, distribution or
copying of this message is strictly prohibited. If you are not the
intended recipient please inform the sender immediately by reply
e-mail and delete this message from your system.
Thank you for your co-operation.