Right, so i have this code:
Byte[] bin = p.GetAsByteArray();
File.WriteAllBytes(@"C:\Report.xlsx", bin);
Now p is an ExcelPackage object, which is a class to manipulate xlsx files.
though p has data the following command just doesn’t create the file and no errors occur.
I Believe it has something to do with the fact that i’m running this on windows 7, however i’m only debugging via VS.
I’m using .Net 4.5,
Anyone knows what can be the issue?
You don’t show enough code to pinpoint the problem exactly… very likely it is one of the following:
security
in newer windows versions (like 7) you are not allowed to store files etc. directly on
C:\anymore.pand/orbinis not in a state that allows saving.EDIT – as per comment:
you can use any of
ApplicationData/CommonApplicationData/LocalApplicationDatafromEnvironment.SpecialFolderin a call toEnvironment.GetFolderPath ()…MSDN reference: http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx