Hi!
I got the same problem. I read the whole thread and tried the examples given. I added these lines to the sample code:
xlRange = (Excel.Range)xlWorkSheet.get_Range("B1", "C1");
xlRange.Merge(Type.Missing);
xlRange = (Excel.Range)xlWorkSheet.get_Range("H5", "M5");
xlRange.Merge(Type.Missing);
xlRange = (Excel.Range)xlWorkSheet.get_Range("N5", "V5");
xlRange.Merge(Type.Missing);
xlRange = (Excel.Range)xlWorkSheet.get_Range("W5", "Z5");
xlRange.Merge(Type.Missing); // up to here everything seems fine
///////////////////////////////////////////////////////////
// if I add these lines below, the process just hanged until
// I manually close the form
xlRange = (Excel.Range)xlWorkSheet.get_Range("AA5", "AB5");
xlRange.Merge(Type.Missing);
xlBorder.Borders.Weight = Excel.XlBorderWeight.xlThin;
///////////////////////////////////////////////////////////
I also added this, before releasing the excelsheet object: Marshal.ReleaseComObject(xlRange);
Please tell me how should I go about this as I am almost giving up on this. Your response is greatly appreciated. FYI, I'm a newbie and I am looking forward to your reply.
Thanks, george