I have code in a program that clears all data from all forms on all sheets.
As part of this program I execute the following code to delete all existing charts:
Dim wsItem As Worksheet
Dim chtObj As ChartObject
For Each wsItem In ThisWorkbook.Worksheets
For Each chtObj In wsItem.ChartObjects
chtObj.Delete
Next
Next
(Code I shamelessly copied from Mr. Excel or another Excel VBA Forum)
I have successfully run this code numerous times during development and repetitive testing sessions.
Now I am getting the following error message:
"Run-time error '-2147024891 (80070005)':
Access denied. You do not have enough privileges to complete this operation."
I have tried:
1. Closing the file and reopening
2. Closing Excel and reopening
3. Restarting my PC
4. Deleted existing Charts manually and re-created them (via other code modules)
to no avail. Any suggestions?
I Googled and found one Microsoft forum article but nothing in that article helped me.
https://social.technet.microsoft.co...50ad6/excel-2007-error-2147024891?forum=excel
The file in question resides on my local hard drive. I am running Excel 2016 on Windows 10.
After extensive testing of all program functionality this is the last hurdle before I can deliver to my customer.
Any/all help would be much appreciated!
As part of this program I execute the following code to delete all existing charts:
Dim wsItem As Worksheet
Dim chtObj As ChartObject
For Each wsItem In ThisWorkbook.Worksheets
For Each chtObj In wsItem.ChartObjects
chtObj.Delete
Next
Next
(Code I shamelessly copied from Mr. Excel or another Excel VBA Forum)
I have successfully run this code numerous times during development and repetitive testing sessions.
Now I am getting the following error message:
"Run-time error '-2147024891 (80070005)':
Access denied. You do not have enough privileges to complete this operation."
I have tried:
1. Closing the file and reopening
2. Closing Excel and reopening
3. Restarting my PC
4. Deleted existing Charts manually and re-created them (via other code modules)
to no avail. Any suggestions?
I Googled and found one Microsoft forum article but nothing in that article helped me.
https://social.technet.microsoft.co...50ad6/excel-2007-error-2147024891?forum=excel
The file in question resides on my local hard drive. I am running Excel 2016 on Windows 10.
After extensive testing of all program functionality this is the last hurdle before I can deliver to my customer.
Any/all help would be much appreciated!