Microsoft Office Forums Occasional 'Overflow' error in constant declaration

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-18-2016, 01:21 PM
Cosmo Cosmo is offline Occasional 'Overflow' error in constant declaration Windows Vista Occasional 'Overflow' error in constant declaration Office 2007
Competent Performer
Occasional 'Overflow' error in constant declaration
 
Join Date: Mar 2012
Posts: 220
Cosmo is on a distinguished road
Default Occasional 'Overflow' error in constant declaration

I have a project that occasionally throws an overflow error wile I am testing it, but it doesn't make any sense. Sometimes it works, then it will start throwing an error, even though the value hasn't been altered. The value is a constant, which hasn't changed, and is well within the variable type's range. example:

Quote:
Private Const constVersion as Single = 3
Once i get the error, I can't run the project, and often it continues even after a restart.



If I change the value (e.g. to a '4'), it works again. But then the error eventually comes back later, and if I change it back to the previous value, then it works again.

Is there possibly something corrupt in my project?
Reply With Quote
  #2  
Old 07-18-2016, 09:20 PM
gmayor's Avatar
gmayor gmayor is offline Occasional 'Overflow' error in constant declaration Windows 10 Occasional 'Overflow' error in constant declaration Office 2016
Expert
 
Join Date: Aug 2014
Posts: 3,008
gmayor is just really nicegmayor is just really nicegmayor is just really nicegmayor is just really nicegmayor is just really nice
Default

How are you using the variable in the project?
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 07-19-2016, 06:16 AM
Cosmo Cosmo is offline Occasional 'Overflow' error in constant declaration Windows Vista Occasional 'Overflow' error in constant declaration Office 2007
Competent Performer
Occasional 'Overflow' error in constant declaration
 
Join Date: Mar 2012
Posts: 220
Cosmo is on a distinguished road
Default

That variable is only used once, added as a value to a dictionary object.

The dictionary is used to set data into the document, but if there was an issue, I'd expect it to be a runtime error when that value is used if it's not the correct type (i.e. an object used where a string is expected), and even that is not the case.

The dictionary values are also written to the document variables collection (which is the only place that this specific constant is written), and a single is a valid type to write to a document variable.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Occasional 'Overflow' error in constant declaration Variable declaration lwhistler Word VBA 2 08-26-2015 04:02 AM
Is there a way to delete the beginning part of an array so it doesn't overflow? omahadivision Excel Programming 4 01-15-2014 11:22 PM
Control direction of resizing textarea on overflow noodle PowerPoint 0 03-31-2013 04:52 AM
Occasional 'Overflow' error in constant declaration Word 2003 "The information you were working on might be lost" constant error message rocketbeta Word 1 08-21-2012 02:54 PM
Occasional 'Overflow' error in constant declaration Keeping the top row constant in Excel MSmand Excel 2 07-13-2011 01:14 PM


All times are GMT -7. The time now is 05:18 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft