Click here to Skip to main content
15,887,330 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have a problem with my current project ,

It have a features of upload excel file ,
i was using epp plus to create it ,

now there was a problem after deploy my app,

i have test on my own pc ,and it was successfully ,

but when i deploy and another user use the features ,it show an error ,

After check the error, i think excel file not succesfully uploaded into temporary folder ,

What I have tried:

I am not sure about the cause ,but i think it can be cause by connection,

but how can i solve this,

is there another way,
can anyone please help me?
Posted
Updated 3-Jul-20 4:05am
Comments
OriginalGriff 26-Jun-20 3:23am    
"it show an error" doesn't help us at all: what message does it give?
What code is running that gives the error?

We can't tell, and there are loads of possible errors, and loads of possible causes for each of them. Without at least the error message and probably the relevant code fragment we can't help you.

Use the "Improve question" widget to edit your question and provide better information.
Member 14760154 26-Jun-20 3:45am    
this is the error message
"System.IndexOutOfRangeException: Worksheet position out of range."

Line 165: ExcelWorksheet worksheet = package.Workbook.Worksheets[1];

when i check ,the excel file doesn't exists in temporary folder
F-ES Sitecore 26-Jun-20 11:08am    
Check you have the permissions to write to the folder you are writing to. For asp.net if you want to save files you should put them in app_data

Collections in C# are zero-based. If you want the 1st worksheet, try this:

C#
ExcelWorksheet worksheet = package.Workbook.Worksheets[0];
 
Share this answer
 
Can you elaborate more so that we can help on exact issue?
 
Share this answer
 
Comments
Richard Deeming 6-Jul-20 10:58am    
If you want to ask for more information, click the "Have a Question or Comment?" button under the question and post a comment. Do not post your comment as a "solution" to the question.
Sweety K 6-Jul-20 11:29am    
Richard, I did that by mistake

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900