It only seems to happen on Excel for Mac 2016 and 2019. I know that starting with Excel for Mac 2016, Excel is “sandboxed”, meaning you cannot save files wherever you want via VBA code. But my code is written to save the file in a particular folder that should always be accessible by Excel, regardless of the sandbox limitation: /Users. Quite simply, Office 2016 doesn't work and will continually crash after working fine a few times, with a spreadsheet containing macros. Until, and I'm starting to wonder if they ever will fix the problem, getting Alldata to work on a Mac running El Capitan and Office 2016 for Mac is impossible.
Code snippet for the Mac. I am getting a 1004 with.Refresh and I don't know why. I have verified the ConnectionString is correct in the QueryTables.Add, I verified the sqlCommand is correct in the same spot.
-->Note
Office 365 ProPlus is being renamed to Microsoft 365 Apps for enterprise. For more information about this change, read this blog post.
Symptoms
Consider the following scenario:
- You have a macro that sets a property of a chart in Microsoft Excel. For example, the macro sets the MaximumScale, MinimumScale, Title, Axis, or Legendproperty of a chart.
- You protect the worksheet. When you do this, you click to select the Edit objects check box in the Protect Sheet dialog box.
- You run the macro.
In this scenario, you receive an error message that resembles one of the following.
Error message 1
Error message 2
Cause
This problem occurs because the Excel object model for the chart is disabled on a protected worksheet.
Workaround
To work around this problem, unprotect the worksheet to enable the macro to run. You can manually unprotect the worksheet or by using the Unprotect method in the macro.
Status
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the 'Applies to' section.
Encountering error with Excel application that you use every day, whether frequently or sometimes; at home or in office, is undoubtedly an unwanted situation. The trouble doubles when the error that you have encountered, is unknown or for the first time. Both Excel XLS and XLSX files become corrupt or damaged at times and may return different errors including runtime errors.
A runtime error that commonly affects MS Excel or its XLS/XLSX files other than Excel runtime 1004, 32809, 57121 error, etc. is Excel Runtime Error 13. Not knowing what to do when there is a time constraint to resolve the error, it is evident for you to get perplexed. This blog is an intent to help you resolve the terrible situation you are experiencing due to runtime error 13. Know all about the error: what is it, its causes and the fixes.
Excel Runtime Error 13
The runtime file error 13 is a type of mismatch error in Excel. Usually, it arises when one or more files or processes are required to launch a program that employs the Visual Basic (VB) environment by default. This means the error occurs when Excel users try to run VBA code containing data types that are not matched in the correct manner. Consequently, ‘runtime error 13: type mismatch Excel’ appears in Excel.
Causes
The Excel runtime error 13 causes are as follows:
- Damaged or incomplete installation of MS Excel application
- The conflict between the Excel application and Operating System
- When a missing menu function or a macro is clicked on by the user from Excel file
- Virus/malware attack or malicious code infection damaging Excel files
- Conflict with other programs while VBA Excel file is open
Fixes
The methods to fix Excel runtime error 13 are as follows:
Fix 1: Make use of the ‘Open and Repair’ utility
MS Excel automatically provides ‘File Recovery’ mode when it discovers a damaged workbook or worksheet. It does this to repair the damaged Excel files. But there are times when Excel does not provide the ‘File Recovery’ mode automatically. This is the time when you can employ ‘Open and Repair’, an inbuilt utility to repair Excel files. The steps to use this utility are:
- Open Excel application
- Go to File->Open
- Select the ‘Excel’ file
- Click the ‘Open’ dropdown
- Click ‘Open and Repair..’ button
- Click ‘Repair’ button to recover as much work as possible Or Click ‘Extract Data’ tab to extract values and formulae
Note: If Open and Repair process is not successful using ‘Repair’ option, use ‘Extract Data’
Fix 2: Uninstall the ‘error causing program’
It is found that some application and software cause the runtime error. Uninstall those application or software to fix the Excel file runtime error. To do so, the steps are:
- Go to ‘Task Manager’ and stop the error causing programs one by one
- Click ‘Start’ menu
- Click ‘Control Panel’ button
- Select ‘Add or Remove Program’ in Control Panel
- All the installed programs on the PC is enlisted
- Select MS Excel and click ‘Uninstall’ to remove it from the PC
Excel Runtime Error 91
Limitations
Excel Runtime 2016
Using Microsoft’s Open & Repair Utility and uninstalling error causing software-programs may or may not resolve Excel Runtime Error 13. In that case a sure-shot and reliable software helps in resolving the error.
Fix 3: Use Stellar Repair for Excel
A professional Excel file repair software that successfully repairs damaged Excel .XLS and .XLSX file without hassle. Recovers all important Excel file components: table, chart, chartsheet, formula, cell comment, image, sort, filter, etc. without data loss or change in the structure or formatting of the files. With user-friendly and intuitive interface having easily accessible tabs, buttons, and menus, the Excel repair process is easy and saves time.
Software with 100% integrity and precision
Excel Runtime Download
Conclusion
You are now aware of the Excel runtime error 13, its causes and steps to resolve it, if the same occurs in Excel XLS/XLSX file. All the three fixes that the blog suggests, are effective in addressing the error. However, Stellar Repair for Excel makes your task of removing Excel runtime errors easy while offering multiple advantages. The software shows preview of the repaired Excel file data before saving it. Along with resolving Excel Runtime Error 13, the software also resolves other errors associated with MS Excel. Further, it maintains workbook properties, cell formatting and overall structure to provide the real-time recovery of Excel file.