Cells Not Taking Changes

R

Raeldor

Hi All,

I have the strangest thing in some code I'm looking at where I am trying to
change a cell (using either Value2, Formula, or ClearContents()) , and the
value is just staying the same. Cells around it will change, but this one
column of cells I cannot change. It's VSTO code, the workbook is
unprotected and the cell is unlocked. ProtectContents is off,
ProtectionMode is set to true.

What else could be restricting a cell from being changed from within VSTO?

Thanks!
Rael
 
J

Jialiang Ge [MSFT]

Hello Rael,

From your post, my understanding on this issue is: you want to know why
some cells in your worksheet is not updated when you set Value2 or call
ClearContents() for them. If I'm off base, please feel free to let me know.

Is it possible that the 'Application. ScreenUpdating = false' is called
before we set the Value2 of the range? If that, the new value will not be
shown until ScreenUpdating is set to true.

Besides, would you let me know if that column of cells has a Validation? Is
there any attribute set to that column but not to others? Would you try to
call ClearContents() directly in Excel VBA and see whether the cell is
updated? or would you run the application in debug mode and step to the
codes where you call ClearContents(), and check whether the value of the
cell is changed in 'Locals' of VS? If possible, would you send a test
project to my email address so that I could have a clearer picture of your
issue?

Sincerely,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
For MSDN subscribers whose posts are left unanswered, please check this
document: http://blogs.msdn.com/msdnts/pages/postingAlias.aspx

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express/Windows Mail, please make sure
you clear the check box "Tools/Options/Read: Get 300 headers at a time" to
see your reply promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jialiang Ge [MSFT]

Hi Rael,

Would you mind letting me know the result of the suggestions? If you need
further assistance, feel free to let me know. I will be more than happy to
be of assistance.

Have a great day!

Sincerely,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
R

Raeldor

Hi,

Sorry for the delay in reply. There was an Excel VBA macro that was
populating the fields after VSTO had done it's thing. My bad.

Thank you very much for your suggestions.

Regards
Ray
 
Top