chrisfleetwood
New Member
- Joined
- Feb 27, 2015
- Messages
- 4
Unable to set the .HorizontalAlignment property of the Range class error
I am encountering this error trying to set HorizontalAlignment in a VB.NET application. I have looked through many articles with solutions on how to resolve this error.
I have tried setting this property in a variety of different contexts (ActiveCell, Range, Selection, ActiveSheet.Cells, etc., etc.) and I am still running into the same error.
Since the code I am working with also protects the active sheet at some point. I've dealt with some other issues in updating a cell where I eventually realized that the cell was within a Excel range I was using elsewhere in the code that had locked the cell in question.
Subsequently, I made sure to unprotect the sheet before attempting to set HorizontalAlignment. Still no luck.
I'm thinking that there may be some external factor that's causing the error over and above the routine syntax/object reference issues.
Any ideas on other factors that would prevent program code from setting HorizontalAlignment? All are appreciated.
Regards,
Chris Fleetwood
I am encountering this error trying to set HorizontalAlignment in a VB.NET application. I have looked through many articles with solutions on how to resolve this error.
I have tried setting this property in a variety of different contexts (ActiveCell, Range, Selection, ActiveSheet.Cells, etc., etc.) and I am still running into the same error.
Since the code I am working with also protects the active sheet at some point. I've dealt with some other issues in updating a cell where I eventually realized that the cell was within a Excel range I was using elsewhere in the code that had locked the cell in question.
Subsequently, I made sure to unprotect the sheet before attempting to set HorizontalAlignment. Still no luck.
I'm thinking that there may be some external factor that's causing the error over and above the routine syntax/object reference issues.
Any ideas on other factors that would prevent program code from setting HorizontalAlignment? All are appreciated.
Regards,
Chris Fleetwood