Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Error message when you expand a scrolling window by using VBA in Microsoft Dynamics GP: "Run-time error '1008': Unsafe Operation"


Symptoms

When you use Visual Basic for Applications (VBA) in Microsoft Dynamics GP and in Microsoft Business Solutions – Great Plains 8.0 to automatically expand a scrolling window (also known as a grid in VBA), you receive the following error message:

Run-time error '1008': Unsafe Operation. An attempt was made to set a value into an application field which is disabled. This operation could compromise the integrity of the application.

↑ Back to the top


Cause

This error occurs if the visible icon for expanding the scrolling window is a non-editable visual switch field that only contains an image. VBA does not allow for the value of a non-editable field to be changed.

↑ Back to the top


Resolution

To resolve this problem, use a hidden push button field that is overlaid with the same size and position as the visual switch icon field.



For more information about how to add a hidden field, click the following article number to view the article in the Microsoft Knowledge Base:

951230 How to add a hidden field with Visual Basic for Applications in Microsoft Dynamic GP

↑ Back to the top


Keywords: kbnosurvey, kbmbsvba, kbexpertiseadvanced, kberrmsg, kbmbspartner, kbtshoot, kbmbsmigrate, kbprb, kb

↑ Back to the top

Article Info
Article ID : 951231
Revision : 1
Created on : 3/13/2017
Published on : 1/5/2015
Exists online : False
Views : 163