ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Workbook Highlighting property (https://www.excelbanter.com/excel-programming/374475-workbook-highlighting-property.html)

ChadF

Workbook Highlighting property
 
I have a piece of code that barfs on the following:


Workbooks(WorkingFileName).Unprotect
Workbooks(WorkingFileName).KeepChangeHistory = True
Workbooks(WorkingFileName).HighlightChangesOnScree n = True

Workbooks(WorkingFileName).Protect

This set is at the bottom of a rather large macro in my application.

Trying to set the HighlightChangesOnScreen flag to True on the fly.

Originally thought that wrapping that statement between a
Workbook Protect/Unprotect would do the trick, but apparantly there's more
to it than that.

Any suggestions ??

Thanks,
Chad


Alok

Workbook Highlighting property
 
Hi Chad,
I have not worked much with Shared workbooks so please excuse me if I am off
the mark here.
I think you have to Share the workbook first.
Thanks.

"ChadF" wrote:

I have a piece of code that barfs on the following:


Workbooks(WorkingFileName).Unprotect
Workbooks(WorkingFileName).KeepChangeHistory = True
Workbooks(WorkingFileName).HighlightChangesOnScree n = True

Workbooks(WorkingFileName).Protect

This set is at the bottom of a rather large macro in my application.

Trying to set the HighlightChangesOnScreen flag to True on the fly.

Originally thought that wrapping that statement between a
Workbook Protect/Unprotect would do the trick, but apparantly there's more
to it than that.

Any suggestions ??

Thanks,
Chad


ChadF

Workbook Highlighting property
 
Hey Alok,

I figured out what the problem was. Turns out that what I wanted to do was
to set up a Worksheet_Change event to change the background colour of a cell
that got changed if a flag was detected.

However I discovered that while this was seemingly 'harmless', what I didnt
bank on was that I had to modify the Application.EventEnable flag for other
operations within my code that did modify colours. What those subs were
doing - changing background colours on their own ... (part of a set of
automatic operations I had going in the Worksheet_Change event definition.)
.... When I wrapped those color change subs inside an Application.Enableevents
= False / True, the problem was corrected.

This post was my first attempt at doing such a thing (figured I'd give the
HighlightChange event a try. Wasnt successful, hence the post.)

Thanks for your input though.

Cheers,
Chad




"Alok" wrote:

Hi Chad,
I have not worked much with Shared workbooks so please excuse me if I am off
the mark here.
I think you have to Share the workbook first.
Thanks.

"ChadF" wrote:

I have a piece of code that barfs on the following:


Workbooks(WorkingFileName).Unprotect
Workbooks(WorkingFileName).KeepChangeHistory = True
Workbooks(WorkingFileName).HighlightChangesOnScree n = True

Workbooks(WorkingFileName).Protect

This set is at the bottom of a rather large macro in my application.

Trying to set the HighlightChangesOnScreen flag to True on the fly.

Originally thought that wrapping that statement between a
Workbook Protect/Unprotect would do the trick, but apparantly there's more
to it than that.

Any suggestions ??

Thanks,
Chad



All times are GMT +1. The time now is 09:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com