< Back

Convert-ExcelRangeToImage

Wed Jan 15, 2020 12:27 am

NAME Convert-ExcelRangeToImage



SYNOPSIS

Gets the specified part of an Excel file and exports it as an image





SYNTAX

Convert-ExcelRangeToImage [-Path] <Object> [[-WorkSheetname] <Object>] [-Range] <Object> [[-Destination] <Object>]

[-Show] [<CommonParameters>]





DESCRIPTION

Excel allows charts to be exported directly to a file, but it can't do this with the rest of a sheet. To work

round this, this function



* Opens a copy of Excel and loads a file



* Selects a worksheet and then a range of cells in that worksheet



* Copies the select to the clipboard



* Saves the clipboard contents as an image file (it will save as .JPG unless the file name ends .BMP or .PNG)



* Copies a single cell to the clipboard (to prevent the "you have put a lot in the clipboard" message appearing)



* Closes Excel



Unlike most functions in the module it needs a local copy of Excel to be installed.





PARAMETERS

-Path <Object>

Path to the Excel file



Required? true

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-WorkSheetname <Object>

Worksheet name - if none is specified "Sheet1" will be assumed



Required? false

Position? 2

Default value Sheet1

Accept pipeline input? False

Accept wildcard characters? false



-Range <Object>

Range of cells within the sheet, e.g "A1:Z99"



Required? true

Position? 3

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Destination <Object>

A bmp, png or jpg file where the result will be saved



Required? false

Position? 4

Default value "$pwd\\temp.png"

Accept pipeline input? False

Accept wildcard characters? false



-Show [<SwitchParameter>]

If specified opens the image in the default viewer.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES











RELATED LINKS





CommonParameters : True

WorkflowCommonParameters : False

details : @{name=ConvertFrom-ExcelSheet; noun=; verb=}

Syntax : @{syntaxItem=System.Object[]}

parameters : @{parameter=System.Object[]}

inputTypes : @{inputType=}

returnValues : @{returnValue=}

aliases : Export-ExcelSheet



remarks : None

alertSet :

description :

examples :

Synopsis :

ConvertFrom-ExcelSheet [-Path] <string> [[-OutputPath] <string>] [[-SheetName] <string>]

[[-Encoding] <string>] [[-Extension] <string>] [[-Delimiter] <string>] [[-Property]

<Object>] [[-ExcludeProperty] <Object>] [[-AsText] <string[]>] [-Append]

[<CommonParameters>]



ModuleName : ImportExcel

nonTerminatingErrors :

xmlns:command : http://schemas.microsoft.com/maml/dev/command/2004/10

xmlns:dev : http://schemas.microsoft.com/maml/dev/2004/10

xmlns:maml : http://schemas.microsoft.com/maml/2004/10

Name : ConvertFrom-ExcelSheet

Category : Function

Component :

Role :

Functionality :