Click here to Skip to main content
15,889,826 members
Home / Discussions / C#
   

C#

 
GeneralRe: Diferences between null,close and dispose Pin
mav.northwind25-Apr-05 20:27
mav.northwind25-Apr-05 20:27 
GeneralRe: Diferences between null,close and dispose Pin
S. Senthil Kumar26-Apr-05 0:33
S. Senthil Kumar26-Apr-05 0:33 
GeneralRe: Diferences between null,close and dispose Pin
turbochimp26-Apr-05 5:10
turbochimp26-Apr-05 5:10 
GeneralRe: Diferences between null,close and dispose Pin
S. Senthil Kumar26-Apr-05 19:17
S. Senthil Kumar26-Apr-05 19:17 
GeneralRe: Diferences between null,close and dispose Pin
turbochimp27-Apr-05 5:19
turbochimp27-Apr-05 5:19 
GeneralRe: Diferences between null,close and dispose Pin
Tom Larsen25-Apr-05 9:31
Tom Larsen25-Apr-05 9:31 
GeneralRe: Diferences between null,close and dispose Pin
Enishi25-Apr-05 22:08
Enishi25-Apr-05 22:08 
GeneralCopy an excel document Pin
fatihsen25-Apr-05 1:34
fatihsen25-Apr-05 1:34 
Hello.

I am trying to copy a worksheet in excel to an another worksheet.Let's say, I have an existing excel file(ExcelSablon.xls) and want to create a new excel file in a different name.

........
// Make an instance of Excel.
ExcelApplication excel = new ExcelApplication();

// Show Excel on the desktop. (fast = running in the background)
excel.Visible = true;

// Add a new workbook.
Workbook workbook = excel.Workbooks.Add(System.Type.Missing);
Workbook workBookSource = excelSource.Workbooks.Open(@"C:\TqmFiles\Templates\ExcelSablon.xls",missing,missing,missing,missing,missing,missing,missing,missing,missing,missing,missing,missing,missing,missing);
Worksheet workSheetSource = (Worksheet)excelSource.Sheets["Sheet1"];

Worksheet worksheet = (Worksheet)excel.ActiveSheet;
worksheet.Copy(workSheetSource,missing);
worksheet.SaveAs("C:\Temp\CopyOfExcelFile.xls", missing, missing, missing, missing, missing, missing, missing, missing, missing);
excel.Quit();

When I try to do this, it gives error in worksheet.Copy(workSheetSource,missing); statement.

Can anybody help me please?








Fatih Sen
GeneralRe: Copy an excel document Pin
turbochimp25-Apr-05 2:49
turbochimp25-Apr-05 2:49 
General[ActiveDirectory] Connect to group Pin
Jaymz66625-Apr-05 1:05
Jaymz66625-Apr-05 1:05 
Generalmixer - balance settings Pin
Mr.Dani25-Apr-05 0:24
Mr.Dani25-Apr-05 0:24 
QuestionHow to bind IList to a DataGridTableStyle? Pin
Member 59674924-Apr-05 23:15
Member 59674924-Apr-05 23:15 
AnswerRe: How to bind IList to a DataGridTableStyle? Pin
Anonymous25-Apr-05 1:08
Anonymous25-Apr-05 1:08 
Generalselecting row from datagrid Pin
anj198324-Apr-05 23:06
anj198324-Apr-05 23:06 
GeneralRe: selecting row from datagrid Pin
Polis Pilavas25-Apr-05 9:19
Polis Pilavas25-Apr-05 9:19 
Generalcontrol another pc in lan Pin
mtbjr24-Apr-05 22:31
mtbjr24-Apr-05 22:31 
GeneralRe: control another pc in lan Pin
.Anonymous25-Apr-05 14:32
suss.Anonymous25-Apr-05 14:32 
GeneralGet remote hardware profile Pin
Yeast2724-Apr-05 21:08
Yeast2724-Apr-05 21:08 
QuestionHow to handle event in PictureBox? Pin
TanutAPI24-Apr-05 19:22
TanutAPI24-Apr-05 19:22 
AnswerRe: How to handle event in PictureBox? Pin
Enishi25-Apr-05 1:43
Enishi25-Apr-05 1:43 
GeneralRe: How to handle event in PictureBox? Pin
TanutAPI25-Apr-05 17:15
TanutAPI25-Apr-05 17:15 
QuestionHow to make a loading screen? Pin
Anonymous24-Apr-05 14:43
Anonymous24-Apr-05 14:43 
GeneralFill many combo in a fORm fROm DB Pin
Jassim Rahma24-Apr-05 11:38
Jassim Rahma24-Apr-05 11:38 
GeneralRe: Fill many combo in a fORm fROm DB Pin
Kodanda Pani24-Apr-05 18:28
Kodanda Pani24-Apr-05 18:28 
GeneralMDI Child without Min, Max or X Pin
Jassim Rahma24-Apr-05 11:30
Jassim Rahma24-Apr-05 11:30 

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.