Phantom Links in Excel - excel

I’m new to this forum and was looking for help with what appears to be a phantom link in my workbook. To isolate the issue, in a Saved As version, I began deleting worksheets until the link disappeared. Here is where it gets strange. I’ve isolated the problem to two sheets. It is only when I delete both sheets that the link disappears. Deleting one or the other, regardless of order, doesn’t eliminate the link. Stranger still, I tried to isolate the issue on those sheets by deleting all controls, macros, data validation, filters, and formulas – each time saving the file and reopening – but still getting the link. It is only when I select all rows and columns and Delete that the issue goes away. This must be done in both sheets. I’m out of ideas on how to troubleshoot this further and was hoping for guidance on some next steps. Any thoughts?
Thank you

Update: I was able to solve this but deleting all Named objects.
Thank you

Related

Strange duplicate sheet named "ThisWorkbook" that shouldn't be there and I can't get rid of

I saw this once before on a different workbook and I think I fixed that one the same way that I did this one but curious (for the next time) if there's a better way and also if anyone know what this is and why it happens. Sometime back in May '22, a new worksheet appeared in my VBA code. For the one referenced in the pic attached, Sheet81 (Bldg Ops) is a valid sheet that at one time was named Sheet8. The sheet is visible, all of my code is there and everything works fine with it. Sheet8 is now the added sheet that I don't need or want and in it is a duplicate of the code from Sheet81. Can't access it and can't delete it.
To fix it, I created a new workbook and copied all of the sheets and code over to it.
Anyone seen this before? Any ideas on the how & why it happens and an easier way to fix it when it does?

View removed VBA code after repair of Excel file

I am getting an error when opening excel: We found a problem with some content in XXX. Do you want us to try and recover as much as we can? if you trust he source of this workbook, click Yes."
clicking Yes, "fixes" the issue but deletes a lot of VBA code, two weeks worth.
Whatever the issue it was introduced yesterday, I do not want to redo two weeks worth of coding. Is there anyway I can view what was removed, or open the VBA in notepad++ or something without opening the excel?
I opened another excel workbook and tried all the different options for the argument XlCorruptLoad in the Workbooks.Open to open the corrupt workbook. I noticed that there were two non existing sheets created in the project explroer of the corrupt workbook that had the code in there. I am not sure if it did that s a result of what I did or it was there all along and I did not notice it
Note that the reason I had a corrupted data is because the code was extracting a list and putting it in a cell validation formula..i guess I overloaded it.

Data Validation Drop Down Box Arrow Disappearing

I have recently been having issues in one of my Excel sheets, I have created a data validation drop down box that refers to a list in an adjacent column (unhidden).
Until today when I clicked on the cell, the drop down arrow appeared but now it briefly flashes before disappearing again, if you click on the right of the cell it still lets you make the selection but other people will use this sheet so it's not really acceptable.
I have checked that the data validation 'In-cell drop down' box is ticked and I don't know where to go from there, has anyone else had this problem? (Google has not been very helpful).
Thank you
I had the same problem and found out that this issue was in my case only related to the speed of the Excel Sheet itself. I had various linked pictures in the workbook that made it very slow, resulting as well in the data validation arrow issue.
Removing the linked pictures would improve the performance and resolve the issue.
(Previously I could resolve it with a workaround by creating a macro in "ThisWorkbook" that goes on two sheets and selects the fields with data validation activated when the workbook is launched:
Sheet("1").Range("DataValidation1").Select
Sheet("2").Range("DataValidation2").Select
Strange enough, this was sufficient to solve the problem.)
I've never personally seen this but have you tried it on another computer or as another user on your computer? I think it just might be some temp files or cache from office that is causing this issue.

Ghost/Phantom Workbooks/sheets appear in VBA Project list alongside legitimate sheets

(edited a day later - see end)
Not sure what's happening here but it's occurring in a few workbooks I'm working with. Over time additional "Phantom" worksheets (or workbooks) appear as shown in the picture. Sheet13, Sheet14, Sheet15 etc are Phantoms and I have no idea how to get rid of them.
What I've tried so far:
1) Searching Google/Stackoverflow no joy but could be a terminology problem
2) Created SUBS to loop through ALL worksheets and workbooks but the only things it finds are the single workbook and the legitimate worksheets.
3) Creating code within one of the phantoms, which is possible. I created a simple SUB on workbook open within Sheet13 to return the name of the sheet or workbook, but no matter what code is there I get
Run Time Error '429':
ActiveX component can't create object
4) Changing properties on the phantoms. The properties for each phantom exactly mirror each other and mirror ThisWorkbook. If I make a change to one, say KeepChangeHistory to False, this is mirrored in ALL phantoms and ThisWorkbook. If I make the change back to True in another phantom, again ALL phantoms and ThisWorkbook are updated.
5) Checked links (greyed out). Tried F5 -> special -> objects "No Objects found".
I've basically tried everything I can think of and searched the internet over the past week before posting this here, as a last resort.
Does anyone have ANY idea what could be causing this (I'm leaning towards some bad object handling somewhere), but also HOW to remove them completely so the only things listed are the actual, real, worksheets?
Thanks for reading.
edit
It affects more than just this workbook (it's happening in 3 different workbooks), it is also getting worse over time. I have saved archived versions of all workbooks. If I go back a month, there are 2 "phantoms", if I go back 2 weeks there are 8 "phantoms" and if I look at one from just last week there are 13 "phantoms". This is one of the reasons I'm assume some poor object handling, likely related to ThisWorkbook is going on. Anyway, I'm going to take Rory's advice and create a new Workbook with NO phantoms and try and figure it out from there. Just want to thank Rory and Mark for taking the time to respond with ideas, it is appreciated.
Well, I guess the simplest answers are the best. What I didn't mention in the question is that each workbook I've worked on that has this problem is uploaded to a 3rd party application, which is, in turn, sent to a second 3rd party application (bespoke apps written by others).
The second application creates 1 or 2 of these "phantoms". I choose to work slightly differently to other developers and I actually use the output from the second application to make changes/fixes, then format that workbook and reupload to application one.
Over time, more and more "phantoms" appear, 1 or 2 per run through this process.
In the end, absolutely nothing to do with Excel, poor code (at least mine!), badly handled objects or anything else.
Thanks again to Rory and Mark for attempting to help. Maybe next time I'll actually start with the mindset of "I'm sure this ISN'T my fault!" and go from there!
I had exactly the same problem. I was reaching the Sheet41111. I used the option Book Inspection in the Information Menu, then I selected remove hidden objects and it luckily worked.
See the image attached, my excel is in Spanish so maybe the option is not really called "Book inspection" in the English version.
Hope it is useful
Pd- Unhide the legitimate sheets because it will delete all hidden sheets. I suggest trying it in a copy of the book. enter image description here enter image description here

Excel Error: Removed Records: Sorting from /xl/worksheets/sheet10.xml part

I'm almost sure I will have to create a new excel file, but maybe at least here I get some ideas what was the source of the problem.
My excel file is constantly giving the following error:
Excel found unreadable content in 'filename.xlsm'. Do you want to recover the contents of this workbook? If you trust the source of this workbook, click Yes.
So I do. And the file opens as repaired showing:
Removed Records: Sorting from /xl/worksheets/sheet10.xml part.
The detail is that I don't even have a sheet10
Its a big excel file full of custom-objects. But I have no DB connections or autofilter so could not relate to AutoFilter Criteria Using Array (Error) - Too Large String? or xlsx error: "Removed Records: Named range from /xl/workbook.xml part" when tried to resolve errors.
Anyone has a clue what's going on?
tks in advance
try clearing the sort before saving down the workbook. When this happened to me I had my sheet references mixed up so the sort wasn't cleared
Sheets(yoursheetname).Sort.SortFields.Clear
I am afraid I cannot explain what is going on, but I had similar experience several times - always with XLSM file. In the latest case I learnt that Excel did not like the same range name used twice, when defined as Worksheet range name (we assumed it is safe to use it that way).
Our troubleshooting path is:
try to save file as XLSB (binary macro file) and either use XLSB file or save it back to XLSM
check file history (we always keep daily snapshots) and find when the problem firstly occurred; use previous version and port your changes
extract the code (via SVN code), create a new workbook and import the code back
Usually Step 1 solves the problem, but Step 3 never failed us.
Awesome,
This issue has been driving me crazy!
It seems that saving as the xlsb (binary) file PLUS adding the clearing of sort fields appears to have sorted out my issue.
I added the following code to the BeforeClose sub, it appears to clear the fields really quick, changes to my Dashboard and prompts for saving.
The xlsb file saved over a mb in file size and appears to load a little quicker!
Thanks for the pointers & support!
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim Sht As Worksheet
' Clear all Sort Fields prior to Save & Exit
For Each Sht In Application.Worksheets
Sht.Sort.SortFields.Clear
Next Sht
aa1_Dashboard1.Select
aa1_Dashboard1.Activate
End Sub
I would like to add my own confirmation regarding clearing sort fields in your spreadsheet, as first suggested by Chris. I specifically had the error occur after I used column sorting in a VBA macro, so I deduced that the problem must be column/field-Sort related. It was.
Adding the line:
Sheets(yoursheetname).Sort.SortFields.Clear
after the sort command allowed the sorted columns to remain sorted (in my case), but cleared whatever was causing the
"Sorting from /xl/worksheets/sheet10.xml part." error when the file was next opened.
Many thanks for your support.
I don't know if this will help anyone but it's solved my problem. I had an excel sheet, nothing complex, just contacts, a much used file in Excel 2010 on Win7. Today I was using the 'filter' to select specific groups to email targeted content to. In the middle of selecting and copying to paste into Outlook, the document came up with a pop up as if I was installing something, then the 'installer' both of which I cancelled out of. The Document closed and then on trying to reopen, I was getting the error message. If I chose 'yes' to repair I was given just the subset of my filtered list, so about 40 of my 350 records, the rest lost. I googled and tried different things, including opening in Googledocs google sheets and nothing worked. I never 'saved' the repaired version as my old data wasn't in that. Just now, I right clicked on my document in explorer and chose "restore previous versions" and it brought me to the version of yesterday - thankfully, nothing added to it since then. Opened that one and bingo, it opened fine with ALL the data in it. I know the filter had corrupted it, so will be cautious next time I use it. I don't know why it doesn't like the filter but 4 hours on, i can now calm down and relax! Hope this helps someone.
was having this issue as well. I have a spreadsheet with multiple tabs (maybe 30 tabs?) and had filters on each sheet, and shared on SharedPoint. The error was not enabling editing of the file on SharePoint. I removed the filters on every sheet and uploaded back to SharePoint and the issue is gone!
I did what Chris mentioned above. Clear the sort fields in your spreadsheet.
Sheets(yoursheetname).Sort.SortFields.Clear
Also, save the file as *.xlsb.
That should get it to work.
When you get a message telling that Excel found unreadable.... just click "Open" and then close all the following messages you get.
-In the VBE open the project showing the name of Addin or the .xlsm.. the click anywhere in any module of the workbook as you are going to edit the text of the macro, then click save, select workbook type like Addin select the folder where you want to save it, give it a new name then click "Save", that is all you have to do, the new file you created will ok.

Resources