|
hi,
what is the exactly com exception ??
|
|
|
|
|
Exception from HRESULT: 0x800AC472
Gurpreet
|
|
|
|
|
Made some changes in the Button_Click event and could not reproduce the issue.
//Range objRange = null;
string cell1 = string.Empty, cell2 = string.Empty;
string[] chars = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T" };
for (int row = 1; row < 1000; row++)
{
for (int column = 0; column < 20; column++)
{
cell1 = chars[column] + row.ToString();
//objRange = _objWorkSheet.get_Range(cell1, cell1);
_objWorkSheet.get_Range(cell1, cell1).Value2 = cell1;
}
}
//System.Runtime.InteropServices.Marshal.ReleaseComObject(objRange);
//objRange = null;
SaveExcel();
|
|
|
|
|
I tried...
but I still get the same error (exception from HRESULT: 0x800AC472)
While the code in for loop is executing, you need to open any other excel file and click on randon cells.
Gurpreet
|
|
|
|
|
I did but still can't reproduce. Using Excel 2010.
|
|
|
|
|
Oh! But I am getting this evevytime i try to do so
My environment is:
Visual Studio 2010
Excel - 2008
Here is the detailed error:
System.Runtime.InteropServices.COMException (0x800AC472): Exception from HRESULT: 0x800AC472
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at Microsoft.Office.Interop.Excel.Range.set_Value2(Object )
at WindowsFormsApplication1.Form1.button1_Click(Object sender, EventArgs e) in c:\documents and settings\kaurrgur\my documents\visual studio 2010\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs:line 77
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Gurpreet
|
|
|
|
|
hi it might work setting the value into the cell by not using the objRange.Value2 property ?!? this is only a suggestion.
|
|
|
|
|
I tried like below but it does not solve the problem
_objWorkSheet.Cells[row, column] = cell1;
Gurpreet
|
|
|
|
|
try setting the .IgnoreRemoteRequests to true right after you open your instance of excel, and don't forget to set it back to false when done as this affects the behavior of your entire environment.
|
|
|
|
|
Finally some solution which works
But still while my code is executing, I cannot open any other excel file... which is not good
If I look at the behaviour of Visual Studio (when I export my work list to excel), it works perfectly fine... no error and I can open the other excel too...
So whats wrong with my code... Is there any other better way to export?
Gurpreet
|
|
|
|
|
As I said in my previous post, this property effects the behavior of the entire system, do some research, the issue you have is common. (hint, setting it back to false will restore expected behavior)
|
|
|
|
|
Yes setting it back restores the behaviour but while export process is on... it is not good that any other excel file cannot be acessed.
Gurpreet
|
|
|
|
|
Again, other excel files can still be accessed, you must open a new instance of excel first, not simply 'double click' on an excel file icon through explorer.
Using this property is still an acceptable and workable solution for you, you just have to do the research to figure out how to keep your excel instance separate from others. Do some research on it. I know, I had the exact same issue you have and worked around it.
|
|
|
|
|
Hi everyone
This morning I needed to use "System Restore" to yesterday.
I completed a project yesterday but when I try to open the project (Visual Studio 2008, C#), it says "Unable to load the project ProjectName.csproj"
What can be done? does anyone has any solutions?
|
|
|
|
|
|
first, Thank you =)
I took a look to the link and tried some of the tips that mentioned in there, but did not work for me.
By the way, the project itself seems normal, there aren't any missing visible files, it just won't open. When I double click the ".sln" of the project, it gives the "unable to load blah blah.csproj" error
|
|
|
|
|
First of all, check that the project file is there and that it's not mangled - open it up in notepad and have a look at it. Compare it to another project for the same version of Visual Studio and do a visual inspection to see if any of the key areas look wrong.
If nothing is obvious, you could try creating a new empty project and then include the files in to it and save that (the project should be for the same platform, e.g. if it's WPF you need the WPF dlls so create an empty WPF project).
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Thank you in advance
I checked the projectName.csproj file, nothing seems wrong.
but something new came up...
When I opened Visual Studio by itself (without indirectly running it by a .sln file) at first, it gave some errors about forms designer tool...etc
after those, I selected new--> project-->C# windows forms project to compare the csproj file, but nothing happened :S
a new project did not created, nothing happened as if I did not select new-Project
wow
it seems like Re-Restore or Re-Install is the only problem :S
"if nothing is obvious, you could try creating a new empty project and then include the files in to it and save that (the project should be for the same platform, e.g. if it's WPF you need the WPF dlls so create an empty WPF project)."
This was my last solution but after this new project creation problem, re-installing seems to be ineviatble
|
|
|
|
|
Strange, but I had seen this before and the solution that worked was the re-installation.
Bad time...
|
|
|
|
|
I can't remember exactly, but it wouldn't surprise me if the installation procedure allows you to fix the install. It's worth taking a look before you uninstall/reinstall.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hello experts,
since I know that cross-posting is evil, here is just a link to the problem description:
Scan for IP cameras
I'm re-posting it here because in the end, it will get integrated into an application that is completely written in C#. Therefore, I'd prefer doing the camera scan in C# as well.
Ciao,
luker
|
|
|
|
|
And your question is....
SkyWalker
|
|
|
|
|
absent?
missing?
lost in action?
missed?
|
|
|
|
|
In order to set a camera's IP to match my network, I have to connect to that very camera.
And here it comes:
How can I connect to a camera whose IP I don't know?
Ciao,
luker
|
|
|
|
|
I expect devices such as yours to have a factory default IP address.
So if the device is new, read the documentation.
And if it has been used before, restore the factory default.
FWIW: my ADSL modem/router has the factory default IP address printed on the bottom.
|
|
|
|