views:

131

answers:

3

hi i have written app on vs2008 c# (express edition) on win XP which reads and creates excel files (excel 2003) using microsoft excel 11.0 object library (because that's the only available one through add references in COM section)... now i publish this project, then copy the setup.exe and take it to my friend's win vista machine, setup goes smoothly but bumps it starts to throw exceptions and stops in the middle of the processes (on my win xp it runs fine without any problems)... plz can you tell me the solution to this problem??? thanks

A: 

Using your XP tested application in a vista environment, most likely it will run into the UAC Wall. Try running your app "as Administrator". You said, that you're creating excel files, so maybe the current user doesn't have permission to write into your target directory.

With this code example, you can check if your app is running on a uac enable OS.

// a really simple check that does not account for possible UAC-disabledness via group policy
public static bool IsUACEnabledOS()
{
int majorVersion = Environment.OSVersion.Version.Major;
int minorVersion = Environment.OSVersion.Version.Minor;

return (majorVersion >= 6);
}

After that, you can this tutorial to request the necessary elevation.

Henrik P. Hessel
A: 

Should really say what the exceptions are otherwise it's a random stab in the dark, but...

Are the same version excel libraries available on the target machine?

JonB
A: 

Where do you create the excel files? May be your programm has not right to access the directory where you store the files.

An other case may be that your friend´s computer does not support the used excel 11.0 object library cause he has an other version of excel (Excel 2007) installed.

Jehof