skip 1st few rows #1332
brucebachmann
started this conversation in
General
Replies: 3 comments 4 replies
-
Please post the sample data, plus how you are passing the password. |
Beta Was this translation helpful? Give feedback.
2 replies
-
Check/search the Examples https://github.com/dfinke/ImportExcel/tree/master/Examples for those parameters and function. |
Beta Was this translation helpful? Give feedback.
0 replies
-
$data = ConvertFrom-Csv @"
Region,State,Units,Price
West,Texas,927,923.71
North,Tennessee,466,770.67
East,Florida,520,458.68
East,Maine,828,661.24
West,Virginia,465,053.58
North,Missouri,436,235.67
South,Kansas,214,992.47
North,North Dakota,789,640.72
South,Delaware,712,508.55
"@
$xlfile = "./test.xlsx"
Remove-Item $xlfile -ErrorAction SilentlyContinue
$excel = $data | Export-Excel $xlfile -AutoSize -StartRow 7 -PassThru
Set-ExcelRange -Worksheet $excel.Sheet1 -Range "A1" -Value "Tri-Star Systems"
Set-ExcelRange -Worksheet $excel.Sheet1 -Range "A2" -Value "Benefit Census Report"
Set-ExcelRange -Worksheet $excel.Sheet1 -Range "A3" -Value "Employer: 350 - ABC Corporation"
Set-ExcelRange -Worksheet $excel.Sheet1 -Range "A4" -Value "Plan Year: 01/01/2023 - 12/31/2023"
Set-ExcelRange -Worksheet $excel.Sheet1 -Range "A5" -Value "Report Date: 12/01/2022"
Close-ExcelPackage $excel -Show |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
just starting using this to convert .csv files to password protected .xlsx files
Import-Csv c:\temp\myCSV.csv | Export-Excel c:\temp\myExcel.xlsx -AutoSize -Password "mypassword"
my csv files have 'report headers' at the very top, 5 or 6 rows with 1 column each
have a couple of issues
Beta Was this translation helpful? Give feedback.
All reactions