Scripting Blog

A place to learn about PowerShell and share stories of automation

How Can I Copy and Rename a Worksheet in the Same Workbook?

Hey, Scripting Guy! I’d like to copy one of the worksheets in an Excel workbook and then paste that copy into the very same workbook; once it’s pasted it, I’d like to rename it. Can I do that?-- JG Hey, JG. Of course you can do this; after all, if you can do something in Excel it’s almost 100% guaranteed that you can do it using a ...

How Can I Make Changes to and Then Re-Save an Existing Excel Spreadsheet?

Hey, Scripting Guy! How can I open an existing Excel spreadsheet, add some additional information to that spreadsheet, and then save my changes? Every time I call the SaveAs method a dialog box pops up asking me if I want to save my changes.-- RW Hey, RW. Generally speaking, you can avoid that dialog box by using the Save method rather than...