EXCEL Workbook creating phantom worksheets that can't be deleted - excel

I have an Excel workbook with some VBA code in modules and in the worksheets. As I use the workbook, Excel will suddenly create ghost/phantom worksheets that can't be deleted. IN the screen shot below the original works sheets, Sheet17 (Main Menu ) and Sheet 25 (Results) ended up getting duplicated (Sheet17, Sheet171, Sheet1711, Sheet 17111; Sheet25, Sheet251, Sheet2511, Sheet25111, etc). The version less than Sheet17111 are ghost worksheets (notice the different icon) that can not be deleted. The VBA code for those worksheets stayed with the latest version of the worksheet (ie. Sheet17111).
The only way to get rid of the ghost worksheets is to save the workbook as an xlsx, close the workbook open up the xlsx, copy over the worksheet code and modules and save out the xlsm. Of course this only corrects the problem until the next occurrence
I am not calling any special addins.
Any tips on what I can try to correct this problem.
Ian

Related

How can I list all worksheet tab names in another workbook in Excel?

I am working with 40+ workbooks and need a list of every named tab in each one, for a cataloguing project. The only macros and instructions I found require creating a formula or macro for each workbook.
I have one file designated as the macro file. In it are two functions, one to sort tabs by color and one to sort them alphabetically. Both work on whatever workbook I have active, as long as the macro workbook is open in the background.
How can I list all the sheet names in the active workbook, using code from the macro workbook?
I don't mind running the command once for each workbook, but I don't want to create a macro in every file.
You can use Workbook.Sheets to access the sheets of a workbook.
Likewise, you can use Workbooks to access the open workbooks.
You can create a nested pair of For loops to iterate through all workbooks, and then all worksheets.

Copy a sheet from another open workbook into current workbook

I'm trying to write a macro that takes Sheet1 from another, already open, workbook and copy it into a the workbook that will use the data. The macro will be run from the workbook that will be receiving the copied sheet and the file I want the data from will always be named the same.
I've tried the follow code, but it either just copies incorrectly or doesn't work.
Workbooks("FileIWantToCopyFrom.XLSX").Sheets("Sheet1").Copy
ActiveWorkbook.Worksheets("FileIWantToCopyFrom.XLSX").Select
Sheets("Sheet1").Copy After:=Workbooks("Book1").Sheets(1)
Any help would be much appreciated. Thanks!

Default Starting Cell in new worksheet

I have been unable to find a solution for this problem: When adding a new worksheet in an Excel workbook, the active cell moves to D20. This behavior is consistent across ALL workbooks that I open or use (new or opening existing workbooks). There are no macros on "ThisWorkbook" or any of the sheets. Has anyone seen this before?
Did you (or someone else) maybe create a custom sheet template?
https://www.rondebruin.nl/win/s9/win016.htm
I saved a single-sheet workbook (with D20 selected) as "sheet.xlt" in my XLSTART folder, and each time I add a new sheet in a workbook I get that same selection in the new sheet.

Same Workbook Hyperlinks keep breaking - Excel

I have a workbook with a mass hyperlinks; all are referring to sheets in the same workbook but they keep breaking once I save the file and reopen it.
The workbook is on a server machine just in case if this info is relevant to the problem.
I know I could use the hyperlink formula but its not applicable in my case so what's causing the hyperlinks to break constantly ?

Add indexed sheets to Excel workbook w/out Openpyxl?

Working with Python 2.7 and I'd like to add new sheets to a current Excel workbook indexed to a specific position. I know Openpyxl's create_sheet command will allow me to specify an index for a new sheet within an existing workbook, but there's a catch: Openpyxl will delete charts from an existing Excel workbook if opened & saved. And my workbook has charts that I don't wish to be deleted.
Is there another way I can open this workbook, create a a few blank sheets that are located precisely after the existing first sheet, all without deleting any of the workbook's charts?
openpyxl 2.5 includes read support for charts

Resources