A string which contains password for Excel workbook. It is necessary when you are converting password-protected Excel document.

Namespace:  SautinSoft
Assembly:  SautinSoft.ExcelToPdf (in SautinSoft.ExcelToPdf.dll) Version: 3.0.9.6

Syntax

      
 C#  Visual Basic 
public string Password { get; set; }
Public Property Password As String

Remarks

Examples

CopyHow to convert password protected workbook in C#
using System;
using System.IO;

namespace Sample
{
    class Sample
    {
        static void Main(string[] args)
        {
            //Convert password protected workbook
            SautinSoft.ExcelToPdf x = new SautinSoft.ExcelToPdf();

            //Set PDF format for output document
            x.OutputFormat = SautinSoft.ExcelToPdf.eOutputFormat.Pdf;

            //Password for Excel workbook
            x.Password = "qwerty";

            string excelPath = @"..\..\..\..\..\test.xls";
            string pdfPath = @"..\..\..\..\..\test.pdf";

            if (x.ConvertFile(excelPath, pdfPath)==0)
            {
                System.Diagnostics.Process.Start(pdfPath);
            }
        }
    }
}
CopyHow to convert password protected workbook in VB.Net
Imports System.IO
Module Sample

    Sub Main()
        'Convert password protected workbook
        Dim x As New SautinSoft.ExcelToPdf()

        'Set PDF format for output document
        x.OutputFormat = SautinSoft.ExcelToPdf.eOutputFormat.Pdf

        'Password for Excel workbook
        x.Password = "qwerty"

        Dim excelPath As String = "..\..\..\..\test.xls"
        Dim pdfPath As String = "..\..\..\..\test.pdf"

        If x.ConvertFile(excelPath, pdfPath) = 0 Then
            System.Diagnostics.Process.Start(pdfPath)
        End If
    End Sub
End Module

See Also