ActiveX Control can't create object - excel

I have a program that opens up a file, pulls data from it, and puts said data into the corresponding worksheet based on the some information form the file it opens (that part isn't important). I have a Power Query that tells me the names and locations of all the files within a specified folder.
The macro will open the sheet with the power query and begin opening/closing and pulling the data from the files one at a time. Up until now, it has run smoothly. However, today I received an error saying "ActiveX Control can't create object." I have never seen this error before. When I go to Debug, it shows me the line with the error:
ThisWorkbook.Worksheets("Query1").Activate
I am unsure as to why it would all of the sudden be erroring out. Any ideas?

Related

How do I open my Excel sheets without VBA error message?

Excel automatically updated last week. Every spreadsheet I open now comes up with error code Run-time error'53':
File not found:
/Library/Application/Application Support/Adobe/MACPDFM/MacPDF.framework/Versions/A/MacPDFM
Help and End buttons show. Help does not describe my problem.
Clicking End twice gets rids of the error message and the spreadsheet opens. I have no idea how to solve this. I am not a programmer and I have not changed any settings in Excel.
Apparently your Excelfile contains a macro, who tries to open the following file when you open an Excel worksheet:
/Library/Application/Application Support/Adobe/MACPDFM/MacPDF.framework/Versions/A/MacPDFM
When this file is not present, you get the mentioned error message.
Seen the structure of the directory, I believe the Excelfile only can be opened on a Mac-computer (Microsoft-computers don't have the mentioned directory structure).
Verify if you're working on a Mac-computer or a Windows-computer and in case of Mac, check the presence (and read permissions) of the mentioned file.

Linking data between two Excel files in SharePoint Online / OneDrive, without having to open both files

I am trying to create two cooperating files, both sitting in SharePoint Online / Onedrive :
Multiple "type A" files, using centrally produced data
One "type B" file, handled by a central team, containing data that will be recovered by all "type A" files
My issue is that the link between files constantly breaks if I don't have both files opened. I'll give you some details below, but my research has shown that it seems to be a common issue, and I couldn't find a satisfactory solution. I've seen suggestions about PowerQuery though
My process: when I create my links in "type A" file (with both files open), it looks like this
=formula('fileB.xlsx'!TableName[#Data])
Everything works fine like this, with both files opened. Close & Save.
Then, user A opens his type A file (without opening file B). EXCEL asks me to "update values", every formula is now broken. Every link has now become :
=formula('https://xxx.sharepoint.com/sites/fileAddress/fileB.xlsx'!TableName[#Data])
Which should work! But it doesn't
when checking the workbooks links, I can check the state of the link, which turns to "OK" after the check. But every value is still broken.
if I change some folder name in SharePoint online, thus modifying the "fileAdress", it is automatically and instantly reproduced in my file A formulas... So the link definitely exists..
Until I open file B, which makes the formula go back to their previous state and fixes the values.
Oh yeah, also I put all my file B data in one sheet, otherwise we had another error message asking to select the right worksheet, when I was using 3 ... And it shouldn't matter cause all my tables are correctly named and the link doesn't even use the worksheet name..

Can't save macro-enabled workbook on remote server after a macro has run

My macro-enabled workbook has been working fine until recently. It runs fine on my local drive, but no longer saves itself when run from a remote folder. I suspect some recent updates on the server are to blame.
If I open the workbook and press the save button, a pop-up appears with a progress bar for a second or two. This has not happened before, but the pop-up does close and allow me to continue.
When I run the macro in the workbook, the last line is ThisWorkbook.Save. The same pop-up appears and hangs. If I close the pop-up and press the save button, it also hangs now. If I choose File> SaveAs, all I get is a blank page with no folders to choose from.
I have a workaround to copy the workbook to a local folder, run the macro, then copy it back to the remote drive, but this may be difficult for my users to handle.
I made a new workbook with a macro that only calls ThisWorkbook.Save from a single button, and this works fine. The problematic workbook gets data from csv files and copies it into itself. Maybe this is causing a problem? Maybe the macros are too large for the anti-malware software to handle?
Does anyone know what recent changes have been made to Server that would cause my old macro to hang on saving?
I got the macro working, but not sure why.
The problem arose with an inefficient way to merge data from two sheets together. I had been using Find, and changed it to march through the data row by row instead. The saving window still pops up, but only for a second.
I don't know exactly why the old method prevented the workbook from being saved. The main difference is that the Find method uses objects, while the method I changed it to use integers and compare cell contents with an if statement. Maybe the memory was being filled with orphaned objects? I don't see what difference that should make when saving the file. The data in the sheets being saved is the same.
If anyone knows what difference this would make in saving a workbook, please add and answer or comment for posterity. It might help someone with a similar problem.

Excel looks for other files that can't be found when opening "Sorry, we couldn't find ........"

I have an excel spreadsheet named "data_covnertot_0.25.xlsm" that has a tonne of VBA in it.
When opening, after the user clicks "Enables Macros" a couple of warnings appear.
These errors occur before any Macros have been run.
There are a few similar queries on Stack Overflow but they either haven't been answered or are regarding add-ons of which I am not using any.
The spreadsheet is saved on ProjectWise however, the error messages occurs regardless of where it is saved.
The error message is:
"Sorry, we couldn't find '...........Copy of data_covnertor_0.18.xlsm'. Is it possible it was moved, renamed or deleted?"
followed a second error message:
"Microsoft Excel cannot access the file '...........Copy of data_covnertor_0.18.xlsm'. There are several possible reasons"
The file name or path does not exist
The file is being used by another program
The workbook you are trying to save has the same name as as a currently open workbook
The spreadsheet works fine after clicking ok to both messages, bit as this will be used by a lot of people I want it to be clean and neat.
The file link in the messages is to a share point site, which is where the spreadsheet was saved before being moved to ProjectWise.
I've had a look through all the VBA, sheets etc, carrying out searches etc, and I can't find any reference to the copy of the old version of this spreadsheet.
Can anyone advise where I should be looking
In my case the cause of the error was a button (a form control button) that was referencing a Macro in a different workbook.
I found the offending button by symptomatically deleting sheets and saving copies of the workbook until the error disappeared.

Excel telling me it can't access a file I don't want it to access

I'm working on a long project and there are many betas with overlapping functionality. I keep raising the number of the beta after making substantial changes.
This file imports a bunch of data from spreadsheets which are exported feeds from a SQL database. It does this with no problem and that part of it has been working for months - importing some raw data sheets and using both cell references and VB to look at it different ways, and I set up a checklist page where the end user can go through certain records one by one and classify them.
All of this works fine and I really only made a few changes today, just finishing off little bits of code that take some data from one sheet and rearrange it in another to export. It was all working with no errors and I copied the file into a new folder (which I have been doing with these templates for months), imported my data (test data in this case), and tried to run the function that copies some info from one sheet onto an another.
Then I get an error from Excel that says "we can't connect to 'https://...my.sharepoint../BETAV9_8_ItemAccountingTEMPLATEetcetc. Please make sure you're using correct web address."
After that I click OK and then I get a second message that says:
Microsoft Excel cannot access the file 'same file' There are several possible reasons:
The file name or path does not exist
The file is being used by another program
The workbook you are trying to save has the same name as a currently open workbook
This file they're telling me they can't find is like 3 betas ago and I've been using subsequent versions without getting this error. That file isn't in the current working folder, nor in the folder from which I copied it originally.
So I'm thinking I have something in my file where there's a reference to an external file, so I went through this process: https://support.microsoft.com/en-us/office/find-links-external-references-in-a-workbook-fcbf4576-3aab-4029-ba25-54313a532ff1?ui=en-us&rs=en-us&ad=us
I don't know where to begin. There is only one thing in the Name Manager (a table that I created on one of these pages with VBA so I can sort it a couple different ways) and the button that says "Delete" is grayed out. There are several references in cells to other files - but not the BETAv9_8 it's telling me it can't find. They are simply file paths/names of the files the user imported - not hidden somewhere in code, just listed on a sheet so the user can check what data she imported.
After going through all these recommended steps I still can't find anywhere in my program that mentions BETAv9_8. In the meantime I'm getting an error for a thing that worked just fine a couple hours ago.
Is this a bug? Is there something I can do to fix it?
Thanks in advance

Resources