Skip to content

Commit 7cbe254

Browse files
SebastianDotNetjozefizso
authored andcommitted
- change release tag 0.8 (excel example01 c#)
- add mass tests folder - add excel mass test (write 1 million cells) Imported from NetOffice r74711 https://netoffice.codeplex.com/SourceControl/changeset/74711
1 parent 8980246 commit 7cbe254

File tree

6 files changed

+246
-3
lines changed

6 files changed

+246
-3
lines changed

Net2.0/Examples/Excel/C#/Example01/FinishDialog.Designer.cs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Net2.0/Examples/Excel/C#/Example01/Form1.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ private void button1_Click(object sender, EventArgs e)
5353
workSheet.get_Range(rangeAdressMouth).Interior.Color = ToDouble(Color.DarkGreen);
5454

5555
// border the face with the border arround method
56-
workSheet.get_Range(rangeAdressFace).BorderAround(XlLineStyle.xlDashDot, XlBorderWeight.xlThin, XlColorIndex.xlColorIndexNone, Color.BlueViolet.ToArgb());
57-
workSheet.get_Range(rangeAdressEyes).BorderAround(XlLineStyle.xlDashDot, XlBorderWeight.xlThin, XlColorIndex.xlColorIndexNone, Color.BlueViolet.ToArgb());
58-
workSheet.get_Range(rangeAdressNoise).BorderAround(XlLineStyle.xlDouble, XlBorderWeight.xlThin, XlColorIndex.xlColorIndexNone, Color.BlueViolet.ToArgb());
56+
workSheet.get_Range(rangeAdressFace).BorderAround(XlLineStyle.xlDashDot, XlBorderWeight.xlThin, XlColorIndex.xlColorIndexAutomatic);
57+
workSheet.get_Range(rangeAdressEyes).BorderAround(XlLineStyle.xlDashDot, XlBorderWeight.xlThin, XlColorIndex.xlColorIndexAutomatic);
58+
workSheet.get_Range(rangeAdressNoise).BorderAround(XlLineStyle.xlDouble, XlBorderWeight.xlThin, XlColorIndex.xlColorIndexAutomatic);
5959

6060
// border explicitly
6161
workSheet.get_Range(rangeAdressMouth).Borders[XlBordersIndex.xlEdgeBottom].LineStyle = XlLineStyle.xlDouble;
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
6+
<ProductVersion>9.0.30729</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{23785F27-FA4D-40AF-A940-7109981F52B9}</ProjectGuid>
9+
<OutputType>Exe</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace>ConsoleApplication1</RootNamespace>
12+
<AssemblyName>ConsoleApplication1</AssemblyName>
13+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
14+
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
15+
<FileAlignment>512</FileAlignment>
16+
</PropertyGroup>
17+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
18+
<PlatformTarget>x86</PlatformTarget>
19+
<DebugSymbols>true</DebugSymbols>
20+
<DebugType>full</DebugType>
21+
<Optimize>false</Optimize>
22+
<OutputPath>bin\Debug\</OutputPath>
23+
<DefineConstants>DEBUG;TRACE</DefineConstants>
24+
<ErrorReport>prompt</ErrorReport>
25+
<WarningLevel>4</WarningLevel>
26+
</PropertyGroup>
27+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
28+
<PlatformTarget>x86</PlatformTarget>
29+
<DebugType>pdbonly</DebugType>
30+
<Optimize>true</Optimize>
31+
<OutputPath>bin\Release\</OutputPath>
32+
<DefineConstants>TRACE</DefineConstants>
33+
<ErrorReport>prompt</ErrorReport>
34+
<WarningLevel>4</WarningLevel>
35+
</PropertyGroup>
36+
<ItemGroup>
37+
<Reference Include="System" />
38+
<Reference Include="System.Core">
39+
<RequiredTargetFramework>3.5</RequiredTargetFramework>
40+
</Reference>
41+
<Reference Include="System.Xml.Linq" />
42+
<Reference Include="System.Data.DataSetExtensions" />
43+
<Reference Include="System.Data" />
44+
<Reference Include="System.Xml" />
45+
</ItemGroup>
46+
<ItemGroup>
47+
<Compile Include="Program.cs" />
48+
<Compile Include="Properties\AssemblyInfo.cs" />
49+
</ItemGroup>
50+
<ItemGroup>
51+
<ProjectReference Include="..\..\..\..\Source\Net v2.0 v3.0 v3.5\Excel\ExcelApi.csproj">
52+
<Project>{999801CF-F213-4DFC-9511-FF9B24B4B664}</Project>
53+
<Name>ExcelApi</Name>
54+
</ProjectReference>
55+
<ProjectReference Include="..\..\..\..\Source\Net v2.0 v3.0 v3.5\LateBindingApi.Core\LateBindingApi.Core.csproj">
56+
<Project>{65442327-D01F-4ECB-8C39-6D5C7622A80F}</Project>
57+
<Name>LateBindingApi.Core</Name>
58+
</ProjectReference>
59+
<ProjectReference Include="..\..\..\..\Source\Net v2.0 v3.0 v3.5\Office\OfficeApi.csproj">
60+
<Project>{9B4FEC3A-AF4F-4841-96D0-A6896D196F94}</Project>
61+
<Name>OfficeApi</Name>
62+
</ProjectReference>
63+
<ProjectReference Include="..\..\..\..\Source\Net v2.0 v3.0 v3.5\VBIDE\VBIDEApi.csproj">
64+
<Project>{F4A471A9-63BE-4453-9C3B-826BF620B61F}</Project>
65+
<Name>VBIDEApi</Name>
66+
</ProjectReference>
67+
</ItemGroup>
68+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
69+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
70+
Other similar extension points exist, see Microsoft.Common.targets.
71+
<Target Name="BeforeBuild">
72+
</Target>
73+
<Target Name="AfterBuild">
74+
</Target>
75+
-->
76+
</Project>
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 10.00
3+
# Visual Studio 2008
4+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApplication1", "ConsoleApplication1.csproj", "{23785F27-FA4D-40AF-A940-7109981F52B9}"
5+
EndProject
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LateBindingApi.Core", "..\..\..\..\Source\Net v2.0 v3.0 v3.5\LateBindingApi.Core\LateBindingApi.Core.csproj", "{65442327-D01F-4ECB-8C39-6D5C7622A80F}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OfficeApi", "..\..\..\..\Source\Net v2.0 v3.0 v3.5\Office\OfficeApi.csproj", "{9B4FEC3A-AF4F-4841-96D0-A6896D196F94}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VBIDEApi", "..\..\..\..\Source\Net v2.0 v3.0 v3.5\VBIDE\VBIDEApi.csproj", "{F4A471A9-63BE-4453-9C3B-826BF620B61F}"
11+
EndProject
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExcelApi", "..\..\..\..\Source\Net v2.0 v3.0 v3.5\Excel\ExcelApi.csproj", "{999801CF-F213-4DFC-9511-FF9B24B4B664}"
13+
EndProject
14+
Global
15+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
16+
Debug|Any CPU = Debug|Any CPU
17+
Debug|Mixed Platforms = Debug|Mixed Platforms
18+
Debug|x86 = Debug|x86
19+
Release|Any CPU = Release|Any CPU
20+
Release|Mixed Platforms = Release|Mixed Platforms
21+
Release|x86 = Release|x86
22+
EndGlobalSection
23+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
24+
{23785F27-FA4D-40AF-A940-7109981F52B9}.Debug|Any CPU.ActiveCfg = Debug|x86
25+
{23785F27-FA4D-40AF-A940-7109981F52B9}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
26+
{23785F27-FA4D-40AF-A940-7109981F52B9}.Debug|Mixed Platforms.Build.0 = Debug|x86
27+
{23785F27-FA4D-40AF-A940-7109981F52B9}.Debug|x86.ActiveCfg = Debug|x86
28+
{23785F27-FA4D-40AF-A940-7109981F52B9}.Debug|x86.Build.0 = Debug|x86
29+
{23785F27-FA4D-40AF-A940-7109981F52B9}.Release|Any CPU.ActiveCfg = Release|x86
30+
{23785F27-FA4D-40AF-A940-7109981F52B9}.Release|Mixed Platforms.ActiveCfg = Release|x86
31+
{23785F27-FA4D-40AF-A940-7109981F52B9}.Release|Mixed Platforms.Build.0 = Release|x86
32+
{23785F27-FA4D-40AF-A940-7109981F52B9}.Release|x86.ActiveCfg = Release|x86
33+
{23785F27-FA4D-40AF-A940-7109981F52B9}.Release|x86.Build.0 = Release|x86
34+
{65442327-D01F-4ECB-8C39-6D5C7622A80F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
35+
{65442327-D01F-4ECB-8C39-6D5C7622A80F}.Debug|Any CPU.Build.0 = Debug|Any CPU
36+
{65442327-D01F-4ECB-8C39-6D5C7622A80F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
37+
{65442327-D01F-4ECB-8C39-6D5C7622A80F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
38+
{65442327-D01F-4ECB-8C39-6D5C7622A80F}.Debug|x86.ActiveCfg = Debug|Any CPU
39+
{65442327-D01F-4ECB-8C39-6D5C7622A80F}.Release|Any CPU.ActiveCfg = Release|Any CPU
40+
{65442327-D01F-4ECB-8C39-6D5C7622A80F}.Release|Any CPU.Build.0 = Release|Any CPU
41+
{65442327-D01F-4ECB-8C39-6D5C7622A80F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
42+
{65442327-D01F-4ECB-8C39-6D5C7622A80F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
43+
{65442327-D01F-4ECB-8C39-6D5C7622A80F}.Release|x86.ActiveCfg = Release|Any CPU
44+
{9B4FEC3A-AF4F-4841-96D0-A6896D196F94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45+
{9B4FEC3A-AF4F-4841-96D0-A6896D196F94}.Debug|Any CPU.Build.0 = Debug|Any CPU
46+
{9B4FEC3A-AF4F-4841-96D0-A6896D196F94}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
47+
{9B4FEC3A-AF4F-4841-96D0-A6896D196F94}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
48+
{9B4FEC3A-AF4F-4841-96D0-A6896D196F94}.Debug|x86.ActiveCfg = Debug|Any CPU
49+
{9B4FEC3A-AF4F-4841-96D0-A6896D196F94}.Release|Any CPU.ActiveCfg = Release|Any CPU
50+
{9B4FEC3A-AF4F-4841-96D0-A6896D196F94}.Release|Any CPU.Build.0 = Release|Any CPU
51+
{9B4FEC3A-AF4F-4841-96D0-A6896D196F94}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
52+
{9B4FEC3A-AF4F-4841-96D0-A6896D196F94}.Release|Mixed Platforms.Build.0 = Release|Any CPU
53+
{9B4FEC3A-AF4F-4841-96D0-A6896D196F94}.Release|x86.ActiveCfg = Release|Any CPU
54+
{F4A471A9-63BE-4453-9C3B-826BF620B61F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
55+
{F4A471A9-63BE-4453-9C3B-826BF620B61F}.Debug|Any CPU.Build.0 = Debug|Any CPU
56+
{F4A471A9-63BE-4453-9C3B-826BF620B61F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
57+
{F4A471A9-63BE-4453-9C3B-826BF620B61F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
58+
{F4A471A9-63BE-4453-9C3B-826BF620B61F}.Debug|x86.ActiveCfg = Debug|Any CPU
59+
{F4A471A9-63BE-4453-9C3B-826BF620B61F}.Release|Any CPU.ActiveCfg = Release|Any CPU
60+
{F4A471A9-63BE-4453-9C3B-826BF620B61F}.Release|Any CPU.Build.0 = Release|Any CPU
61+
{F4A471A9-63BE-4453-9C3B-826BF620B61F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
62+
{F4A471A9-63BE-4453-9C3B-826BF620B61F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
63+
{F4A471A9-63BE-4453-9C3B-826BF620B61F}.Release|x86.ActiveCfg = Release|Any CPU
64+
{999801CF-F213-4DFC-9511-FF9B24B4B664}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
65+
{999801CF-F213-4DFC-9511-FF9B24B4B664}.Debug|Any CPU.Build.0 = Debug|Any CPU
66+
{999801CF-F213-4DFC-9511-FF9B24B4B664}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
67+
{999801CF-F213-4DFC-9511-FF9B24B4B664}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
68+
{999801CF-F213-4DFC-9511-FF9B24B4B664}.Debug|x86.ActiveCfg = Debug|Any CPU
69+
{999801CF-F213-4DFC-9511-FF9B24B4B664}.Release|Any CPU.ActiveCfg = Release|Any CPU
70+
{999801CF-F213-4DFC-9511-FF9B24B4B664}.Release|Any CPU.Build.0 = Release|Any CPU
71+
{999801CF-F213-4DFC-9511-FF9B24B4B664}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
72+
{999801CF-F213-4DFC-9511-FF9B24B4B664}.Release|Mixed Platforms.Build.0 = Release|Any CPU
73+
{999801CF-F213-4DFC-9511-FF9B24B4B664}.Release|x86.ActiveCfg = Release|Any CPU
74+
EndGlobalSection
75+
GlobalSection(SolutionProperties) = preSolution
76+
HideSolutionNode = FALSE
77+
EndGlobalSection
78+
EndGlobal
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
6+
using Excel = NetOffice.ExcelApi;
7+
8+
namespace ConsoleApplication1
9+
{
10+
class Program
11+
{
12+
static void Main(string[] args)
13+
{
14+
// init api
15+
LateBindingApi.Core.Factory.Initialize();
16+
17+
Console.WriteLine("Write 1 million cells in excel.");
18+
19+
Excel.Application application = new NetOffice.ExcelApi.Application();
20+
application.DisplayAlerts = false;
21+
application.Interactive = false;
22+
application.ScreenUpdating = false;
23+
24+
application.Workbooks.Add();
25+
26+
Excel.Worksheet workSheet = (Excel.Worksheet)application.Workbooks[1].Worksheets[1];
27+
28+
// row
29+
for (int i = 1; i <= 10000; i++)
30+
{
31+
// column
32+
for (int y = 1; y <= 100; y++)
33+
{
34+
Excel.Range cells = workSheet.Cells;
35+
Excel.Range range = cells[i, y];
36+
range.Value = "TestValue";
37+
range.Dispose();
38+
cells.Dispose();
39+
}
40+
41+
if (i % 100 == 0)
42+
Console.WriteLine("{0} Cells written.", (i * 100));
43+
}
44+
45+
// quit and dispose
46+
application.Quit();
47+
application.Dispose();
48+
49+
Console.WriteLine("Done!");
50+
}
51+
}
52+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// Allgemeine Informationen über eine Assembly werden über die folgenden
6+
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
7+
// die mit einer Assembly verknüpft sind.
8+
[assembly: AssemblyTitle("ConsoleApplication1")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("NetOffice")]
13+
[assembly: AssemblyCopyright("Copyright © 2011")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
18+
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
19+
// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
20+
[assembly: ComVisible(false)]
21+
22+
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
23+
[assembly: Guid("5ed817ab-e4cd-41d6-ac36-b6a6c83327bb")]
24+
25+
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
26+
//
27+
// Hauptversion
28+
// Nebenversion
29+
// Buildnummer
30+
// Revision
31+
//
32+
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
33+
// übernehmen, indem Sie "*" eingeben:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

0 commit comments

Comments
 (0)