Click here to Skip to main content
15,568,627 members
Home / Discussions / C#
   

C#

 
GeneralRe: Detecting Enter in a Single-line Textbox Pin
Paul Riley27-Sep-02 13:48
Paul Riley27-Sep-02 13:48 
GeneralRe: Detecting Enter in a Single-line Textbox Pin
Anonymous27-Sep-02 14:04
Anonymous27-Sep-02 14:04 
GeneralRe: Detecting Enter in a Single-line Textbox Pin
Paul Riley27-Sep-02 14:15
Paul Riley27-Sep-02 14:15 
GeneralRe: Detecting Enter in a Single-line Textbox Pin
Waleed Eissa27-Sep-02 13:24
Waleed Eissa27-Sep-02 13:24 
GeneralRe: Detecting Enter in a Single-line Textbox Pin
Paul Riley27-Sep-02 13:54
Paul Riley27-Sep-02 13:54 
Questionhelp ? Pin
imran_rafique25-Sep-02 12:10
imran_rafique25-Sep-02 12:10 
AnswerRe: help ? Pin
leppie25-Sep-02 13:56
leppie25-Sep-02 13:56 
GeneralOpening Excel workbook Pin
Donald Blachly25-Sep-02 11:26
Donald Blachly25-Sep-02 11:26 
I am trying to open an Excel workbook to use in my C# application. I have found many examples of opening a blank (new) workbook using new Excel.Application(). How do I open a specific xls file using Excel.Application ?

//open Excel with new workbook
Excel.Application excel = new Excel.Application();
excel.Application.Workbooks.Add(true);
excel.Application.Visible = true;

I have been able to open a specific file using Process

string path = "C:\\";
string file = "flow.xls";
System.Diagnostics.Process xlProcess = new System.Diagnostics.Process();
xlProcess.EnableRaisingEvents = false;
xlProcess.StartInfo.FileName = "excel";

xlProcess.StartInfo.Arguments = path + file;
xlProcess.Start();

as long as the path has no spaces.

But with a path like
string path = "C:\\Documents and Settings\\userName\\My Documents\\data\\FlowData\\flow.xls";

I also tried a verbatim string
string path = @"C:\Documents and Settings\userName\My Documents\data\FlowData\flow.xls";

How do I add the spaces to the path?



When you come to a fork in the road, take it! Y. Berra
GeneralRe: Opening Excel workbook Pin
Stephane Rodriguez.25-Sep-02 22:11
Stephane Rodriguez.25-Sep-02 22:11 
GeneralRe: Opening Excel workbook Pin
Donald Blachly26-Sep-02 4:50
Donald Blachly26-Sep-02 4:50 
QuestionHow to activate event procedure Pin
D Shen25-Sep-02 10:42
D Shen25-Sep-02 10:42 
AnswerRe: How to activate event procedure Pin
leppie25-Sep-02 10:57
leppie25-Sep-02 10:57 
GeneralRe: How to activate event procedure Pin
D Shen25-Sep-02 11:51
D Shen25-Sep-02 11:51 
GeneralRe: How to activate event procedure Pin
leppie25-Sep-02 12:55
leppie25-Sep-02 12:55 
GeneralRe: How to activate event procedure Pin
D Shen26-Sep-02 4:50
D Shen26-Sep-02 4:50 
GeneralRe: How to activate event procedure Pin
D Shen26-Sep-02 5:15
D Shen26-Sep-02 5:15 
GeneralRe: How to activate event procedure Pin
D Shen26-Sep-02 5:26
D Shen26-Sep-02 5:26 
GeneralRe: How to activate event procedure Pin
leppie26-Sep-02 8:17
leppie26-Sep-02 8:17 
GeneralRe: How to activate event procedure Pin
leppie25-Sep-02 13:08
leppie25-Sep-02 13:08 
Questionmultiple search patterns with Directory.GetFiles? Pin
Wjousts25-Sep-02 10:41
Wjousts25-Sep-02 10:41 
AnswerRe: multiple search patterns with Directory.GetFiles? Pin
Paul Riley25-Sep-02 11:29
Paul Riley25-Sep-02 11:29 
GeneralHere is a tough one - DataGrid throwing exception while repainting Pin
Luis Alonso Ramos25-Sep-02 8:25
Luis Alonso Ramos25-Sep-02 8:25 
GeneralRe: Here is a tough one - DataGrid throwing exception while repainting Pin
leppie25-Sep-02 8:45
leppie25-Sep-02 8:45 
GeneralRe: Here is a tough one - DataGrid throwing exception while repainting Pin
Luis Alonso Ramos25-Sep-02 10:05
Luis Alonso Ramos25-Sep-02 10:05 
GeneralRe: Here is a tough one - DataGrid throwing exception while repainting Pin
leppie25-Sep-02 10:20
leppie25-Sep-02 10:20 

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.