Feb 27 2024 03:27 PM
The following code has never given an error until now:
Sheets("Template").Visible = True
The error is
I was able to eliminate the error by writing
Dim sh as Worksheet set sh = Sheets("Template") sh.Visible = True
This is the Office 365 version of Excel. Since Office apps are updated automatically, could an automatic update by Microsoft have caused this? There was an Excel update on Feb 13.
Feb 27 2024 09:55 PM
Using a variable to reference the worksheet, as you've done in your workaround, is generally a good practice in VBA programming. It can help make your code more robust and easier to maintain, as well as potentially avoid issues like the one you encountered.
The runtime error -2147319767 (8028029) is a "Automation error" in VBA, indicating that there's an issue with automating or accessing a particular object or method. This error can occur due to various reasons, such as:
To troubleshoot and resolve this issue, you can try the following steps:
If none of the above steps resolve the issue, you may need to provide more specific details about your VBA code and the circumstances under which the error occurs for further assistance. The text was created with the help of AI.
My answers are voluntary and without guarantee!
Hope this will help you.
Was the answer useful? Mark as best response and like it!
This will help all forum participants.