Unable to set the .HorizontalAlignment property of the Range class error

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
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Forum statistics

Threads
1,214,585
Messages
6,120,397
Members
448,957
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top