|
Thanks Eddy,
I had a solution for this. I used Interop.Excel to open the file and Save as a normal workbook, and the result is ok (the size is smaller, and don't have any problems).
Thanks and regards,
|
|
|
|
|
The default "SaveAs" option in this spreadsheet is to save as XML Spreadsheet, which is text, and therefore takes much more space on disk. Save it as Excel Workbook and it is the same size.
Use the best guess
|
|
|
|
|
Hi Richard,
I used "Save" button (not SaveAs), but the size is bigger after saving
|
|
|
|
|
Yes, and it is because the default format for saving this file is XML Spreadsheet, as I mentioned above. If you open that file with a text editor you will see that it is an XML file. You need to use SaveAs to change the default to Excel Workbook.
Use the best guess
|
|
|
|
|
Oh, you are right.
How can I save this file to Excel Workbook using C# ? So, users only need to open and save it (not save as)
I used below codes to save xml string as .xls file.
<pre lang="c#">
FileStream fs = File.Open(path, FileMode.Create, FileAccess.Write);
StreamWriter stmWriter = new StreamWriter(fs, System.Text.Encoding.UTF8);
stmWriter.Write(strXMLContent);
Thanks and regards,
Tai
|
|
|
|
|
|
Before, I tried to use Interop.Excel but, It is quite slow to create file.
So I used StreamWriter to write xml string, and it is more quickly.
Is it possible to use Interop.Excel to create excel file from XML String ?
Are there any otherway ?
Thanks and regards,
Tai
|
|
|
|
|
Fine, but what you end up with is an XML Spreadsheet, not an Excel Workbook. You need to decide which is best for your application.
Use the best guess
|
|
|
|
|
Ok, thank you for your help
|
|
|
|
|
in my example it's show that I put only one marker but lets say I add much more markers and I only want to remove marker in my array in index 0.
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
if (CheckBox1.Checked == true)
{
GMap1.addGMarker(markers1[0]);
}
else
{
}
}
modified 6-Apr-13 17:51pm.
|
|
|
|
|
Hi Guys,
Do you have any idea on how to automate website using c# windows form? If so, can you provide me. I am a new bee in automation and I want to automate my testing in the website.
Thanks,
Nico
|
|
|
|
|
Create a new project, throw a WebBrowser component on there, and <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.navigate.aspx">Navigate</a>[<a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.navigate.aspx" target="_blank" title="New Window">^</a>] where you want.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi everyone, I have a problem, we borrow our clients laptops in our company for a short time. Users should be the local admin of the computer in order to add/remove programs they need. However, some of them didn't return the laptops in time so, we decided to write a program that locks the computer on date that we give before. I have one windows service, one form application which interacts with user and communicates with the service. While I testing, when I kill my program or my service, I give bsod but, when I try to disable the service and restart my computer, it doesn't run anymore. I need a method to prevent disable my service. Even my form application gets killed, my service has to run in background. Thanks.
|
|
|
|
|
candogu wrote: we borrow our clients laptops in our company for a short time
Presumably you mean that you lend them to your clients.
candogu wrote: we decided to write a program that locks the computer on date that we give
before
Seems like an unlikely and complicated solution. Why don't you just send them a bill, with an appropriate markup, as the replacement cost of the computer? The markup should be high enough that it allows you to buy a new computer and cover collection agency costs. Presumably the clients are in fact capabable of covering that cost or you shouldn't be lending it to them in the first place.
candogu wrote: I need a method to prevent disable my service
I am rather certain that is impossible. You can however make it difficult.
But really will this fix your problem? Are you sure the clients will return the computer then? What stops them from just throwing it in the trash?
|
|
|
|
|
I'd boot in safe mode and install my own "fun.exe" before returning it to you
While there's few valid reasons to be late in returning the laptop, there's none in locking it. You have a list of people whom you lent it to; send them a mail and charge them a small fee for each day that it's not returned.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Since everyone is an admin, you can't, really.
|
|
|
|
|
ThePhantomUpvoter is that ur account
|
|
|
|
|
I think I speak for everyone when I say "What?"
|
|
|
|
|
I think this may be an exercise in redundancy.
He is asking everyone if the ThePhantomUpvoter account is your account, but there is only one account that can answer this, ThePhantomUpvoter. A bit like asking all the integers if they are the number 17. The question might even have deep existentialist qualities, but if it does, I've failed to discern them.
“Education is not the piling on of learning, information, data, facts, skills, or abilities - that's training or instruction - but is rather making visible what is hidden as a seed” “One of the greatest problems of our time is that many are schooled but few are educated”
Sir Thomas More (1478 – 1535)
|
|
|
|
|
Yes, it isn't mine.
“Education is not the piling on of learning, information, data, facts, skills, or abilities - that's training or instruction - but is rather making visible what is hidden as a seed” “One of the greatest problems of our time is that many are schooled but few are educated”
Sir Thomas More (1478 – 1535)
|
|
|
|
|
sorry sir Thomas
but i want to send an Email to this person so he could help me with my code
and i don't know how to send it to him
|
|
|
|
|
youshy wrote: i want to send an Email to this person so he could help me with my code
That's generally frowned upon by the recipients. It's unwanted requests like this that led to me removing the option to email me.
|
|
|
|
|
thank you
|
|
|
|
|
It is not my account. I certainly wouldn't welcome people e-mailing me directly for help. e-Mailing like this also goes against the purpose of Code Project, as the idea is to share problems so that other can see them and hopefully use any answers given.
“Education is not the piling on of learning, information, data, facts, skills, or abilities - that's training or instruction - but is rather making visible what is hidden as a seed” “One of the greatest problems of our time is that many are schooled but few are educated”
Sir Thomas More (1478 – 1535)
|
|
|
|
|
thank you
|
|
|
|