|
Hi all,
I have made an application in which i need to save my data in excel sheet, for doing this i have used
using Microsoft.Office.Core;
using Excel = Microsoft.Office.Interop.Excel;
as namespace and its functions..
My problem is my exe run's fine on windows vista and higher version but it is not running on windows xp. When i run it on xp it gives exception.
I am not getting what i am missing in my application.
Thanks in advance
|
|
|
|
|
Do you have Excel installed on the XP machine? Is it the right version, or higher?
If not, it won't work...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
|
Did you install the correct .NET framework? Did you install the correct Interop DLL's[^]?
I are Troll
|
|
|
|
|
|
satendrasitu wrote: how i install interop
As described in the link that I posted, that's the reason why it's included
Do read the note at the bottom;
MSDN states; PIAs are version specific, so you should use the same version of the PIAs as the application version. For example, if you want to migrate your Microsoft Office XP managed code solution to Microsoft Office 2003, you should recompile the Office XP managed code solution with Office 2003 PIAs.
You should also have two different setup packages—one for Office XP and another for Office 2003—if you intend for the same solution to work in both Office XP and Office 2003. Deployment of PIAs for Office XP is very different from that for Office 2003. For further information about these differences, see the ReadMe file included in the Office XP PIAs download[^].
I are Troll
|
|
|
|
|
thanks for this, but how I include this with my exe , because it is not run in client mechine
modified on Friday, April 1, 2011 5:46 AM
|
|
|
|
|
satendrasitu wrote: thanks for this, but how I include this with my exe
Using a set-up application that installs all required components. Or, you'll have to copy them manually. You can't link them into the executable itself.
..wel, you could add it as an embeddable resource, unpack it and load it on demand, but that would probably cost more than the trouble would be worth.
I are Troll
|
|
|
|
|
Change your username as soon as possible, otherwise you'll wind up with endless adverts for hair-loss remedies, herbal viagra and pics of nudie ladies and/or gents in your inbox. Unless you want that of course .
|
|
|
|
|
Actually this type of problem occur due to .net framework missing on the Client System.
to run .net application it required its perquisites. It runs on higher version of XP because .net framework resides implicitly which is not in XP.
so be confirm about it or give us more details what exception is generating while running your application on XP.
|
|
|
|
|
which exception it is throwing?
|
|
|
|
|
Is it possible to use LINQ on an un-typed IList collection? Specifically I'm interested in ListView.SelectedItems. I want to remove every item except item "i".
Not sure how that would work since if I don't know the type, how would I run the query? Although, I'd really only be comparing object o.
|
|
|
|
|
It is not untyped, ListView.SelectedItems returns a collection of ListViewItem(s).
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark Nischalke wrote:
It is not untyped, ListView.SelectedItems returns a collection of
ListViewItem(s).
----
You are mistaken sir . ListView.SelectedItems most certainly does NOT return ListViewItems (unless you are binding to stock ListViewItems). It returns whatever type you are binding with.
If my ItemsSource is a ObservableCollection<Widget>, SelectedItems returns a collection of Widgets, not ListViewItems.
The definition of ListView.SelectedItems is:
[BindableAttribute(true)]
public IList SelectedItems { get; }
As you can see, un-typed .
Also, when I look in the debugger, SelectedItems is actually a:
- SelectedItems Count = 1 System.Collections.IList {System.Windows.Controls.SelectedItemCollection}
System.Windows.Controls.SelectedItemCollection is a private class.
Naturally, this fails:
IList<ListViewItem> selectedItems = SelectedItems as IList<ListViewItem>;
because it ain't that type . Unless you meant something else.
But regardless, as I look in the debugger, <whatever you want to say SelectedItems returned>[0] is NOT a ListViewItem, its a Widget.
My issue is that I don't know what type it is, so I need to do a RemoveAllExceptThis as an object.
|
|
|
|
|
I stand corrected. I was thinking of something else
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I don't think so, not directly at least, the standard LINQ operators work on IEnumerable<T> , whereas ListView.SelectedListViewItemCollection only implements IEnumerable . Could be wrong though!
|
|
|
|
|
Yeah, thats what it seems like... Oh well. Thanks anyways.
|
|
|
|
|
It shouldn't be too hard to create your own specialized wrapper version of the collection, perhaps with an explicit conversion operator, that implements IEnumerable<T>
|
|
|
|
|
Meh... I just gave up on the LINQ idea and used a regular loop. Much easier .
|
|
|
|
|
It often is!
For the sake of the thread... this could do with some more work, but using a generic ListViewItem class and the Cast method of Linq, something like this works.
public class ListViewItem<T> : ListViewItem
{
private T data;
public T Data
{
get { return data; }
set { data = value; }
}
public static IEnumerable<ListViewItem<T>> GetListViewSelectedItems(ListView listView)
{
return listView.SelectedItems.Cast<ListViewItem<T>>();
}
}
ListViewItem<string> itemA = new ListViewItem<string>();
itemA.Data = "a";
itemA.Text = "A";
ListViewItem<string> itemB = new ListViewItem<string>();
itemB.Data = "b";
itemB.Text = "B";
listView.Items.Add(itemA);
listView.Items.Add(itemB);
IEnumerable<ListViewItem<string>> selectedItems =
ListViewItem<string>.GetListViewSelectedItems(listView);
|
|
|
|
|
Hah... nice. Well, I gave you a 5 for the effort. I figured it could be done someway, but thats waaaay overkill for what I was trying to do . Thanks though.
|
|
|
|
|
i have downloaded your project mp3 player.
it works great. i want to develop vcd cutter in your mp3 player. kindly help me from where i do start. waiting for the reply.
thanks
|
|
|
|
|
You start by contacting the person who wrote the project, there is a comment section at the bottom. This is a general C# forum, we have no idea which project you downloaded.
|
|
|
|
|
you should go there from where you have download project and then ask question by using New Message at the Comment and Discussions.
take a look at the bottom you will find it easily.
|
|
|
|
|
HI,
I want to know that how to count the number of messages in sim memory and how to get the index of last message stored in memory using c#.I dont have any idea how to do this. I am using At command for "AT+CMGR=index" for reading sms. But i dont know how to get the index number of last message stored in memory.
Thanks in advance.
Regards,
Aeman
modified on Saturday, April 2, 2011 9:23 AM
|
|
|
|