Skip to content

Commit

Permalink
Bug fix, added error if xlsx file is open in excel
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasss93 committed Aug 9, 2016
1 parent e682222 commit 0de81fa
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
15 changes: 13 additions & 2 deletions XLSX2RESW/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,18 @@ static void Main(string[] args)
}
catch(Exception ex)
{
MessageBox.Show(ex.Message + "\n\n" + ex.StackTrace, "Exception");
switch(ex.HResult)
{
case -2147024864:
MessageBox.Show("Please close your xlsx file from excel first!","Error");
break;

default:
MessageBox.Show(ex.Message + "\n\n" + ex.StackTrace, "Exception " + ex.HResult);
Debug.WriteLine(ex.Message + "\n\n" + ex.StackTrace, "Exception " + ex.HResult);
break;
}

}

//exit
Expand Down Expand Up @@ -118,7 +129,7 @@ private static List<JProject> ReadFile()


project_code = result.Tables[0].Rows[1][i].ToString();
for(int j = 2; j <= totalRows; j++)
for(int j = 2; j < totalRows; j++)
{
project_values.Add(new JValues()
{
Expand Down
4 changes: 2 additions & 2 deletions XLSX2RESW/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
// usando l'asterisco '*' come illustrato di seguito:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
2 changes: 1 addition & 1 deletion XLSX2RESW/XLSX2RESW.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.1.0.0</ApplicationVersion>
<ApplicationVersion>1.2.0.0</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
Expand Down

0 comments on commit 0de81fa

Please sign in to comment.