<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Visual Basic Script Archives | DMC, Inc.</title>
	<atom:link href="https://static.dmcinfo.com/blog/tag/visual-basic-script/feed/index.xml" rel="self" type="application/rss+xml" />
	<link></link>
	<description></description>
	<lastBuildDate>Wed, 22 Jul 2026 19:10:45 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.2</generator>

<image>
	<url>https://static.dmcinfo.com/wp-content/uploads/2025/04/site-icon-150x150.png</url>
	<title>Visual Basic Script Archives | DMC, Inc.</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>WinCC 7: Disable Global Color Scheme &#038; Global Shadow</title>
		<link>https://static.dmcinfo.com/blog/21515/wincc-7-disable-global-color-scheme-global-shadow/</link>
		
		<dc:creator><![CDATA[John Michael Frullo]]></dc:creator>
		<pubDate>Wed, 22 May 2019 09:02:39 +0000</pubDate>
				<category><![CDATA[HMI and SCADA]]></category>
		<category><![CDATA[Manufacturing Automation & Intelligence]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Visual Basic Script]]></category>
		<category><![CDATA[WinCC]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/21515/wincc-7-disable-global-color-scheme-global-shadow/</guid>

					<description><![CDATA[<p>Have you ever been trying to change the color properties (ex. background color) of an object in WinCC 7, and it just won’t budge? Are you already familiar with the global color scheme property and constantly find yourself turning it off? Are you looking for a better way to customize objects during development without having [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/21515/wincc-7-disable-global-color-scheme-global-shadow/">WinCC 7: Disable Global Color Scheme &#038; Global Shadow</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Have you ever been trying to change the color properties (ex. background color) of an object in <a href="/services/manufacturing-automation-and-intelligence/hmi-and-scada-programming/siemens-simatic-wincc-programming">WinCC 7</a>, and it just won’t budge? Are you already familiar with the global color scheme property and constantly find yourself turning it off? Are you looking for a better way to customize objects during development without having to change this property all the time?</p>



<p class="wp-block-paragraph">Well then, I have a solution for you!</p>



<h2 id="h-the-good-solution" class="wp-block-heading">The Good Solution</h2>



<p class="wp-block-paragraph">Sure, you can disable global color scheme (and while we’re at it, global shadow) on each object by selecting that object on the screen, selecting <strong>“Effects”</strong> under the <strong>Properties tab</strong>, and changing the global color scheme and global shadow to<strong> “No.”</strong> Now, you can change the properties of that object all you want.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Disable-global-schema-good.png" alt="Global color scheme in porta"/></figure>



<h2 id="h-the-better-solution" class="wp-block-heading">The Better Solution</h2>



<p class="wp-block-paragraph">Now, if you’re doing any serious development and adding many items to screens, then this individualized property changing gets old pretty quickly.&nbsp;Well, luckily, you can create default properties for items before they are placed on the screen. Select the object you’re going to put on the screen in the item navigator pane. Then, <strong>before</strong> you place the item, go to <strong>“Effects”</strong> again, and <strong>disable </strong>the global color scheme and global shadow.</p>



<p class="wp-block-paragraph">Now, you can place as many circles as you like without having to change those properties each time.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/global-schema-better.png" alt="the better way to disable"/></figure>



<p class="wp-block-paragraph">This change persists after you close the project and restart your computer, so the project default settings will be there for you the next time you’re ready to continue development.</p>



<h2 id="h-the-best-solution" class="wp-block-heading">The Best Solution</h2>



<p class="wp-block-paragraph">The above step is nice and easy, but it suffers from some drawbacks. First, you have to do this for every object type that you’ll be adding (circles, rectangles, I/O Fields, etc.). Second, this setting only applies to the project you’re working on.</p>



<p class="wp-block-paragraph">So, if you have several projects that you are working on – say if you’re a developer or you have one engineering station for multiple or distributed projects in your plant – then you would need to do this every time you open a different project. If you are ready to be rid of the global color scheme for all projects on your computer, let me introduce you to <strong>VBA in WinCC 7</strong>.</p>



<p class="wp-block-paragraph">VBA can be used within WinCC 7 for automatic configuration of the <strong>Graphics Designer</strong> (create and edit pictures, objects, menus, and dynamics) and other editors (Tag Management, Alarm Logging, etc.). By modifying the Global Template, we can perform a check when an object is created, or a picture is opened to disable the global color scheme and shadow properties.</p>



<p class="wp-block-paragraph">To open the VBA editor, open Graphics Designer. Then under <strong>Tools &gt; Macros</strong>, select <strong>Visual Basic Editor</strong> (or hit Alt + F11).</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/global-schema-best.png" alt="macros in graphics designer"/></figure>



<p class="wp-block-paragraph">Once the Visual Basic Editor opens, we will select the Global Template to make our modifications.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/disable-global-schema-in-portal.png" alt="VBA editor"/></figure>



<p class="wp-block-paragraph">To disable the global color scheme and global shadow for <strong>objects</strong>, add the following code to the Global Template.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">VB</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>Private Sub Document_HMIObjectAdded( _
    ByVal ThisObject As IHMIObject, _
    CancelForwarding As Boolean)

    ' Any errors received are likely because a device
    ' (for example, a faceplate) does not have these properties.
    ' Continue execution if an error occurs.
    On Error Resume Next

    ' Disable the global color scheme
    ThisObject.GlobalColorScheme.Value = False

    ' Disable the global shadow effect
    ThisObject.GlobalShadow.Value = False

End Sub</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #569CD6">Private Sub </span><span style="color: #DCDCAA">Document_HMIObjectAdded</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE"> _</span></span>
<span class="line"><span style="color: #D4D4D4">    ByVal ThisObject As </span><span style="color: #4EC9B0">IHMIObject</span><span style="color: #D4D4D4">,</span><span style="color: #9CDCFE"> _</span></span>
<span class="line"><span style="color: #D4D4D4">    CancelForwarding As </span><span style="color: #4EC9B0">Boolean</span><span style="color: #D4D4D4">)</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #6A9955">&apos; Any errors received are likely because a device</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #6A9955">&apos; (for example, a faceplate) does not have these properties.</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #6A9955">&apos; Continue execution if an error occurs.</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">On Error Resume Next</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #6A9955">&apos; Disable the global color scheme</span></span>
<span class="line"><span style="color: #D4D4D4">    ThisObject.GlobalColorScheme.</span><span style="color: #9CDCFE">Value</span><span style="color: #D4D4D4"> =</span><span style="color: #569CD6"> False</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #6A9955">&apos; Disable the global shadow effect</span></span>
<span class="line"><span style="color: #D4D4D4">    ThisObject.GlobalShadow.</span><span style="color: #9CDCFE">Value</span><span style="color: #D4D4D4"> =</span><span style="color: #569CD6"> False</span></span>
<span class="line"></span>
<span class="line"><span style="color: #569CD6">End Sub</span></span></code></pre></div>



<p class="wp-block-paragraph">To disable the global color scheme for <strong>pictures</strong>, add the following code to the Global Template.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">VB</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>Private Sub Document_Activated(CancelForwarding As Boolean)

    ' The faceplate editor does not support the GlobalColorScheme property.
    ' Ignore any errors that occur while attempting to disable it.
    On Error Resume Next

    ' Disable the global color scheme for the active document
    Application.ActiveDocument.GlobalColorScheme.Value = False

End Sub</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #569CD6">Private Sub </span><span style="color: #DCDCAA">Document_Activated</span><span style="color: #D4D4D4">(</span><span style="color: #9CDCFE">CancelForwarding</span><span style="color: #D4D4D4"> As </span><span style="color: #4EC9B0">Boolean</span><span style="color: #D4D4D4">)</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #6A9955">&apos; The faceplate editor does not support the GlobalColorScheme property.</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #6A9955">&apos; Ignore any errors that occur while attempting to disable it.</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">On Error Resume Next</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #6A9955">&apos; Disable the global color scheme for the active document</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #4EC9B0">Application</span><span style="color: #D4D4D4">.ActiveDocument.GlobalColorScheme.</span><span style="color: #9CDCFE">Value</span><span style="color: #D4D4D4"> =</span><span style="color: #569CD6"> False</span></span>
<span class="line"></span>
<span class="line"><span style="color: #569CD6">End Sub</span></span></code></pre></div>



<p class="wp-block-paragraph">Save the <strong>Global Template</strong>, and you are all finished! You can now open/add pictures and add objects to those pictures to test out your additions.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/full-code-to-disable.png" alt="full code in vba"/></figure>



<p class="wp-block-paragraph"><strong>Note:</strong> if you only want to make these changes on the project level rather than for your computer, you can add the above code to the <strong>Project Template</strong> file instead.</p>



<p class="wp-block-paragraph"><strong>From the WinCC 7 Manual: (Working with WinCC/VBA for Automated Configuration/Introduction: Using VBA in WinCC/Organizing VBA Code in a WinCC Project)</strong></p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/wincc-manual-instructions.png" alt="manual in wincc instructions"/></figure>



<p class="wp-block-paragraph">You can reference the help files for more details about what you can do with VBA in WinCC 7.</p>



<p class="wp-block-paragraph">Learn more about DMC&#8217;s <a href="/services/manufacturing-automation-and-intelligence/hmi-and-scada-programming/siemens-simatic-wincc-programming">WinCC Expertise</a> and <a href="/contact">contact us today</a> to get started on your next project!</p>
<p>The post <a href="https://static.dmcinfo.com/blog/21515/wincc-7-disable-global-color-scheme-global-shadow/">WinCC 7: Disable Global Color Scheme &#038; Global Shadow</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
