|
Could it be that the "." (the decimalseparator) is interpreted as a thousand-separator?I are Troll
|
|
|
|
|
"." is not a thousandseperator
its like a date value seperator or date is in yyyy.mm format
but i need actual value like "2009.03" where 2009 is year and 03 is month.
|
|
|
|
|
Have you tried setting the numberformat to "yyyy.mm"?I are Troll
|
|
|
|
|
|
I've created a test-sheet in Excel (2007) and succesfully changed the NumberFormat using an adapted version of your code;
using XL = Microsoft.Office.Interop.Excel;
[...].
object oMissing = System.Reflection.Missing.Value;
XL.Application App = new XL.ApplicationClass();
XL.Workbook WorkBook = App.Workbooks.Open("C:\\Book1.xlsx",
oMissing, oMissing, oMissing, oMissing, oMissing, oMissing,
oMissing, oMissing, oMissing, oMissing, oMissing, oMissing,
oMissing, oMissing);
XL.Worksheet Sheet = (XL.Worksheet)WorkBook.Worksheets[1];
XL.Range thisRange = (XL.Range)(Sheet.Cells[1, 1]);
thisRange.NumberFormat = "yyyy.mm";
WorkBook.Save();
WorkBook.Close(false, oMissing, oMissing); Some points to keep in mind;- You'll need the correct Office Interop assemblies
- The value that you're formatting needs to be a "real" date. (Not a string that contains month & year)
Hope this helps I are Troll
|
|
|
|
|
Hi, all,
My application involves installation of different parts of the project in different computers on a local network. I want the administrator to check and/or start/stop different services on different PC's remotely using command line. I use C#. I don't know what technology to use. Should I use telnet/ssh or is use of WMI(System.Management Name Space) enough?.Or is there another method?. I don't want to use remote desktop or window's built-in telnet client. Nor do I want to use remote admin software like pcAnywhere. If it is possible to use both telnet/ssh and WMI, which one is better?.
|
|
|
|
|
You can use the SC [^] command to control services, somewhat similar to this;
sc \\MyComputerName stop "NameOfTheService" I are Troll
|
|
|
|
|
yes you are right Eddy Vluggen. But i want to start/stop exe's, not registered services alone. also, I want to make the commands simple, for example, by giving list of numbers to choose and choosing the number runs something or brings another list of choices.
|
|
|
|
|
kebedetesema wrote: i want to start/stop exe's
You can use the GetProcesses [^] method to generate a Proces class for all executables on the remote machine I are Troll
|
|
|
|
|
Yes you are right but I also want to start/stop exe's, not installed services alone. also I want to make the commands simple, for example, by giving a list of choice(number) and selecting a number runs a service or exe file etc
|
|
|
|
|
kebedetesema wrote: but I also want to start/stop exe's, not installed services alone.
Starting and stopping executables is done over the Process class, if you have the required permissions. Services can't be killed that way, hence the suggestion to use the SC.exe command.
That would enable you to start/stop executables and to start/stop services. If that's not what you want then I have misinterpreted the question.
kebedetesema wrote: also I want to make the commands simple, for example, by giving a list of choice(number) and selecting a number runs a service or exe file etc
I'm imagining a console-application that shows a menu, am I close?I are Troll
|
|
|
|
|
Yes Exactly. I want console-application that shows a menu,but then do you mean I can use The Process class in the console application and that is enough?
|
|
|
|
|
kebedetesema wrote: do you mean I can use The Process class in the console application and that is enough?
Yup, should be enough to start or stop processes on another computer I are Troll
|
|
|
|
|
Guys,
Iam very nave to this community. If some body is using Vista or W-7, we get search option on Top right of the exlplorer. The moment we type some sam, it searches and the list will be displayed, from where we can we double click the appopriate window will be displayed.
I want to know that what is the control that he is using and how he is displaying the window upon double click.
Can any body help me out.. I want to develop a Search Engine tool same like W-7 or Vista.
Thanks in Advance....
|
|
|
|
|
Pardhu2 wrote: I want to know that what is the control that he is using and how he is displaying the window upon double click.
That's not a standard component from the .NET framework; you'll have to search for a third-party library that offers a similar control or write your own.I are Troll
|
|
|
|
|
The Windows 7 SDK should contain samples about using the System search engine.
|
|
|
|
|
I want to create a Shortcut icon on Desktop for Windows Vista or Windows 7, Iam getting that Access Denied. what i came to know is we need Special Permissions for Vista and 7, How do we get it can any body suggest me the solution for it.
For windows Xp it works Fine....
|
|
|
|
|
Gud day everyone..
There are only two common suggestions in the internet on how to inform the users when program is busy : 1. backgroundworker 2.threading...
i want to make my own modal window with animated GIF in it. said window will display during processing and it will stop after the process. how will i do it? can anyone give me a sample....
thanks in advance.xxx
|
|
|
|
|
I have done something similar, which was a borderless progress form with an animated gif, and a background worker on it. You just hook up to the DoWork and RunWorkerCompleted events as normal.
Having said that, although it worked fine in a small scale application, for a larger app I ended up writing my own threading code. Ideally the window should be modeless. But then you have to intercept all mouse and keyboard messages to ensure the end user cannot click elsewhere.
|
|
|
|
|
The window should be modal to prevent the user from making any action while it is processing... I tried to making a separate window with animated GIf and called it under another thread but it still doesnt work..
can you give me a sample how will i do it..
thanks in advance..xxx
|
|
|
|
|
Could be a largish code chunk. I'll see if I can slim it down. The key though is that the window is launched on the main GUI thread, but performs it's work on a secondary thread.
|
|
|
|
|
Email on it's way to you. It was far to big to post here.
Maybe one day I will write it up as an article.
|
|
|
|
|
Got a much better Wait Window available now. Posting the code to you made me think about what I had and I have vastly improved on the code now.
I have posted it as an Article A simple wait window[^].
|
|
|
|
|
You posted a lot,,, it really helps and I want to thank you for this effort...
thank you againxxx
|
|
|
|
|
Your welcome. It helped me to clean up my code as well.
|
|
|
|