Comments (3)
@merill Thanks for trying ImportExcel and the request. That can be done in a couple ways. Let me know how it goes. I'll add this to the examples folder.
$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 = "$PSScriptRoot\spike.xlsx"
Remove-Item $xlfile -ErrorAction SilentlyContinue
function UseActivate {
$data | Export-Excel -Path $xlfile -WorksheetName Tab1
$data | Export-Excel -Path $xlfile -WorksheetName Tab2 -Activate
$data | Export-Excel -Path $xlfile -WorksheetName Tab3 -Show
}
function UseSelectWorksheet {
$data | Export-Excel -Path $xlfile -WorksheetName Tab1
$data | Export-Excel -Path $xlfile -WorksheetName Tab2
$data | Export-Excel -Path $xlfile -WorksheetName Tab3
$xlpkg = Open-ExcelPackage $xlfile
Select-Worksheet -ExcelPackage $xlpkg -WorksheetName Tab3
Close-ExcelPackage $xlpkg -Show
}
UseSelectWorksheet
from importexcel.
Amazing. That worked perfectly @dfinke thanks a lot.
Interestingly, I was trying to figure it out yesterday and copilot was totally hallucinating. It did get very close with Set-ActiveSheet instead of Select-Worksheet. Even the parameter names were correct.
from importexcel.
Cool. When copilot first came out I was promoting it about PowerShell and Excel. Didn’t know about my module. Took a few months is additional training. Then it knew some things and started hallucinating function names. I was like hmm, those are better ones than I came up with.
from importexcel.
Related Issues (20)
- Exporting hashtable to new (empty) file doesn't transfer as expected HOT 4
- Exporting with default theme now renders as purple after recent office update? HOT 11
- New-ConditionalText Question HOT 1
- Exporting worksheet to csv while keeping excel formats (where applicable) HOT 9
- Set-ExcelRange -Formula issue HOT 1
- KillExcel fails
- Close-ExcelPackage -Show broken on MacOS due to PowerShell issue HOT 1
- Add -Calculate to Open-ExcelPackage and Import-Excel
- Export-Excel -Style work wrong with multiple sheets HOT 4
- Help with getting a Table without Headers HOT 6
- Exception calling "Save" with "0" argument(s) HOT 3
- Faulty Hyperlink to web site using OfficeOpenXml.ExcelHyperLink HOT 2
- Question: How to colorize header columns HOT 3
- Question: How to match a keyword (stored in a variable) in a specific column and color a range? HOT 2
- Formatting OutPut HOT 1
- Created PivotTables that have same SourceWorkSheet and same SourceRange, but manually created slicer cannot see both of them HOT 2
- TableTotalSettings Formulas transformed by Excel HOT 3
- Bug: Spreadsheet with data above StartRow causes column headers to be duplicated HOT 6
- Set-excelrange after export-excel with '-append' results in exception
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from importexcel.