Feedback Form
Showing posts with label C#. Show all posts
Showing posts with label C#. Show all posts

Saturday, August 02, 2008

Subsonic going visual ( SubStage )

Subsonic is going up in subsonic,

everyday we feel how subsonic is a very good tool.

They created a good visual tool called SubStage to easily  generate code.

http://subsonicproject.com/2-1-pakala/using-substage/

 subsonic

Friday, February 01, 2008

Excel file in new excel instance

You can open any excel file using code like this:

Process.Start(filePath);

But what will happen if we have these 2 lines of code:

Process.Start(filePathONE);

Process.Start(filePathTWO);

Will first open “filePathONE” in a new excel instance, then will open the “filePathTwo” in the same excel instance.

What we can do if we want to open each file in a separate new excel instance?

We must write it like that:

Process.Start(“Excel.exe”, filePathONE);

Process.Start(“Excel.exe”, filePathTWO);

It’s very simple, isn’t it?

But we can face a small problem with this way:

If you want to open an excel file that contains space in its name, for example “my Sheet.xls”, it will give you a runtime error that it can’t open files “my.xls” and “Sheet.xls”.

So what can I do?

It’s simple:

Just add “ before and after the file path, just like that:

Process.Start(“Excel.exe”, @“””filePathONE”””);

Like that it will open normally without any errors.

Note:

You will need to do the same for any office application (word, powerpoint, ….).

kick it on DotNetKicks.com