Link Search Menu Expand Document

Create Simple Spreadsheet - C++ (managed)

Spreadsheet SDK sample in C++ (managed) demonstrating ‘Create Simple Spreadsheet’

#include "stdafx.h"

using namespace System;
using namespace System::Reflection;
using namespace System::Runtime::CompilerServices;
using namespace System::Runtime::InteropServices;
using namespace System::Security::Permissions;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly:AssemblyCopyrightAttribute("Copyright (c)  2010")];

// Version information for an assembly consists of the following four values:
//      Major Version
//      Minor Version
//      Build Number
//      Revision
// You can specify all the value or you can default the Revision and Build Numbers
// by using the '*' as shown below:




[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)];

// HelloWorld.cpp : main project file.

#include "stdafx.h"

using namespace System;
using namespace System::IO;
using namespace Bytescout::Spreadsheet;

int main(array<System::String ^> ^args)
    // Create new Spreadsheet
	Spreadsheet document;

	// Add new worksheet
	Worksheet^ worksheet = document.Workbook->Worksheets->Add("HelloWorld");

	// Set cell value
	worksheet->Cell(0, 0)->Value = "Hello, World!";

	// delete output file if exists already
	if (File::Exists("Output.xls"))

	// Save document

	// Close Spreadsheet


    return 0;

// Microsoft Visual C++ generated include file.
// Used by app.rc

// stdafx.cpp : source file that includes just the standard includes
// HelloWorld.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information

#include "stdafx.h"

// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently

#pragma once

// TODO: reference additional headers your program requires here

Download Source Code (.zip)

Return to the previous page Explore Spreadsheet SDK

Copyright © 2016 - 2021 ByteScout