Aspose.Cells for Go via C++ is a native Go library designed for Go developers to programmatically create, manipulate, and convert spreadsheets without needing Office Automation or Microsoft Excel. It supports a variety of spreadsheet formats, including MS Excel 97-2003 (XLS), MS Excel 2007-2016 (XLSX, XLSM, XLSB), Open Office XML, and more. With Aspose.Cells for Go via C++, you can also extract images from worksheets and convert Excel files to PDF. The library further enables the creation and manipulation of charts and shapes. Additionally, it offers robust formula calculation capabilities, providing you with a comprehensive solution for spreadsheet management.
- Windows x64
- Linux x64
- Go 1.16 or greater
- Create a directory for your project and a main.go file within. Add the following code to your main.go.
package main
import (
. "github.com/aspose-cells/aspose-cells-go-cpp/v25"
"fmt"
)
func main() {
lic, _ := NewLicense()
lic.SetLicense_String("YOUR_LICENSE_File_PATH")
workbook, _ := NewWorkbook()
worksheets, _ := workbook.GetWorksheets()
worksheet, _ := worksheets.Get_Int(0)
cells, _ := worksheet.GetCells()
cell, _ := cells.Get_String("A1")
cell.PutValue_String_Bool("Hello World!", true)
style, _ := cell.GetStyle()
style.SetPattern(BackgroundType_Solid)
color, _ := NewColor()
color.Set_Color_R(uint8(255))
color.Set_Color_G(uint8(128))
style.SetForegroundColor(color)
cell.SetStyle_Style(style)
workbook.Save_String("HELLO.pdf")
}
- Initialize project go.mod
go mod init main
- Fetch the dependencies for your project.
go mod tidy
If Aspose.Cells for Go via C++ is not installed in the development environment, Go will automatically install the package in the $GOPATH
subdirectory.
- Set your PATH to point to the shared libraries in Aspose.Cells for Go via C++ in your current command shell. Replace your_version with the version of Aspose.Cells for Go via C++ you are running.
set PATH=%PATH%;%GOPATH%\github.com\aspose-cells\aspose-cells-go-cpp\v25@v25.7.0\lib\win_x86_64\
Or in your powershell
$env:Path = $env:Path+ ";${env:GOPATH}\github.com\aspose-cells\aspose-cells-go-cpp\v25@v25.7.0\lib\win_x86_64\"
Or in your linux bash
export PATH=$PATH:$GOPATH/github.com/aspose-cells/aspose-cells-go-cpp/v25@v25.7.0/lib/linux_x86_64/
You may also copy the DLL files from the above path to the same place as your project executable.
- Run your created application.
go run main.go
Aspose.Cells for Go via C++ offers a wide arrange of features for creating, converting and manipulating spreadsheets:
- Built-In Properties
- Custom Properties
- Themes
- Styles and Formatting
- Data Validation
- Conditional Formatting
- Hyperlink
- AutoFilter
- PageSetup
- Reading, Writing and Calculating Formulas
- Group Rows and Columns
- PivotTable
- Table
Format | Description | Load | Save |
---|---|---|---|
XLS | Excel 95/5.0 - 2003 Workbook. | √ | √ |
XLSX | Office Open XML SpreadsheetML Workbook or template file, with or without macros. | √ | √ |
XLSB | Excel Binary Workbook. | √ | √ |
XLSM | Excel Macro-Enabled Workbook. | √ | √ |
XLT | Excel 97 - Excel 2003 Template. | √ | √ |
XLTX | Excel Template. | √ | √ |
XLTM | Excel Macro-Enabled Template. | √ | √ |
XLAM | An Excel Macro-Enabled Add-In file that's used to add new functions to Excel. | √ | |
CSV | CSV (Comma Separated Value) file. | √ | √ |
TSV | TSV (Tab-separated values) file. | √ | √ |
TXT | Delimited plain text file. | √ | √ |
HTML | HTML format. | √ | √ |
MHTML | MHTML file. | √ | √ |
ODS | ODS (OpenDocument Spreadsheet). | √ | √ |
JSON | JavaScript Object Notation | √ | √ |
DIF | Data Interchange Format. | √ | |
Adobe Portable Document Format. | √ | ||
XPS | XML Paper Specification Format. | √ | |
SVG | Scalable Vector Graphics Format. | √ | |
TIFF | Tagged Image File Format | √ | |
PNG | Portable Network Graphics Format | √ | |
BMP | Bitmap Image Format | √ | |
EMF | Enhanced metafile Format | √ | |
JPEG | JPEG is a type of image format that is saved using the method of lossy compression. | √ | |
GIF | Graphical Interchange Format | √ | |
MARKDOWN | Represents a markdown document. | √ | |
SXC | An XML based format used by OpenOffice and StarOffice | √ | √ |
FODS | This is an Open Document format stored as flat XML. | √ | √ |
DOCX | A well-known format for Microsoft Word documents that is a combination of XML and binary files. | √ | |
PPTX | The PPTX format is based on the Microsoft PowerPoint open XML presentation file format. | √ |
You can use Aspose.Cells for Go via C++ free of cost for evaluation.The evaluation version provides almost all functionality of the product with certain limitations. The same evaluation version becomes licensed when you purchase a license and add a couple of lines of code to apply the license. If you want to test Aspose.Cells for Go via C++ without evaluation version limitations, you can also try a 30-Day Temporary License. Please refer to How to get a Temporary License?
The evaluation version of Aspose. Cells for Go via C++ provides complete product functionality. An evaluation watermark will be inserted when saving the file. And the evaluation version can open up to 100 files.
A commercial license key is required in a production environment. Please contact us to purchase a commercial license if you want to publish application to the product server.
- From Go 1.16, you use
go install
command directly to install the Aspose.Cells for Go via C++ package. The command allows for the global installation of command-line tools without worrying about affecting existing project dependencies.
go install github.com/aspose-cells/aspose-cells-go-cpp/v25@latest
- When you use
go get
command to install the Aspose.Cells for Go via C++ package, need exist the go.mod file in the current directory or any parent directory. see to installation Aspose.Cells for Go via C++ package and running your code in your project
go get github.com/aspose-cells/aspose-cells-go-cpp/v25@v25.7.0
-
Create a work directory for your project.
-
Get the source code about Aspose.Cells for Go via C++ source package
- Clone the source code from GitHub
git clone https://github.com/aspose-cells/aspose-cells-go-cpp.git cells-go-cpp
Or
- Download the source code package from the Aspose.Cells for Go via C++ download page and extract the ZIP file to cells-go-cpp folder in your work directory.
- Navigate to cells-go-cpp folder and build source code
cd "your work directory"/cells-go-cpp/
go build .
- Set your PATH to point to the shared libraries in Aspose.Cells for Go via C++ in your current command shell.
set PATH=%PATH%;%YourProjectPath%\cells-go-cpp\lib\win_x86_64\
Or in your powershell
$env:Path = $env:Path+ ";${YourProjectPath}\cells-go-cpp\lib\win_x86_64\"
Or in your bash
export PATH=$PATH:${YourProjectPath}/cells-go-cpp/lib/linux_x86_64/
- Navigate to the
./samples
directory and run all sample.
go run .