<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Save VBA in .dvb during run time to keep key in data in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/save-vba-in-dvb-during-run-time-to-keep-key-in-data/m-p/2260292#M19704</link>
    <description>He..He..&lt;BR /&gt;
Maybe I ask too much from you guys. Anyway.. Thanks for all your support..</description>
    <pubDate>Mon, 26 May 2008 00:21:06 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2008-05-26T00:21:06Z</dc:date>
    <item>
      <title>Save VBA in .dvb during run time to keep key in data</title>
      <link>https://forums.autodesk.com/t5/vba-forum/save-vba-in-dvb-during-run-time-to-keep-key-in-data/m-p/2260284#M19696</link>
      <description>I'd develop autocad vba to automatically draw our complete drawing but cannot keep our key in data during run time. Could anyone please help me on this ?? I've spent alot of time on this.</description>
      <pubDate>Wed, 21 May 2008 03:22:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/save-vba-in-dvb-during-run-time-to-keep-key-in-data/m-p/2260284#M19696</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-21T03:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Save VBA in .dvb during run time to keep key in data</title>
      <link>https://forums.autodesk.com/t5/vba-forum/save-vba-in-dvb-during-run-time-to-keep-key-in-data/m-p/2260285#M19697</link>
      <description>do you want to save the data or just display it after rouitne is run?&lt;BR /&gt;
&lt;BR /&gt;
John&lt;BR /&gt;
&lt;AWIE_TECH&gt; wrote in message news:5936528@discussion.autodesk.com...&lt;BR /&gt;
I'd develop autocad vba to automatically draw our complete drawing but &lt;BR /&gt;
cannot keep our key in data during run time. Could anyone please help me on &lt;BR /&gt;
this ?? I've spent alot of time on this.&lt;/AWIE_TECH&gt;</description>
      <pubDate>Wed, 21 May 2008 10:45:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/save-vba-in-dvb-during-run-time-to-keep-key-in-data/m-p/2260285#M19697</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-21T10:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Save VBA in .dvb during run time to keep key in data</title>
      <link>https://forums.autodesk.com/t5/vba-forum/save-vba-in-dvb-during-run-time-to-keep-key-in-data/m-p/2260286#M19698</link>
      <description>Depending on what kind of data you are referring to, you can save to a text file or save to the registry as a few suggestions.&lt;BR /&gt;
&lt;BR /&gt;
http://mechcad-insider.blogspot.com/</description>
      <pubDate>Wed, 21 May 2008 12:12:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/save-vba-in-dvb-during-run-time-to-keep-key-in-data/m-p/2260286#M19698</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-21T12:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: Save VBA in .dvb during run time to keep key in data</title>
      <link>https://forums.autodesk.com/t5/vba-forum/save-vba-in-dvb-during-run-time-to-keep-key-in-data/m-p/2260287#M19699</link>
      <description>"Key" ??&lt;BR /&gt;
&lt;BR /&gt;
If you are trying to dynamically "hard code" a "serial number" or the like&lt;BR /&gt;
into your .dvb at runtime, check out "VBE"&lt;BR /&gt;
&lt;BR /&gt;
Here is a sample from help:&lt;BR /&gt;
Sub Example_VBE()&lt;BR /&gt;
    ' This example uses the VBA IDE extensibility model to dynamically&lt;BR /&gt;
    ' create a VBA subroutine. After running this example, see the first&lt;BR /&gt;
line of code&lt;BR /&gt;
    ' in the VBA IDE code window to see a new subroutine. Then&lt;BR /&gt;
    ' remove the new subroutine before continuing.&lt;BR /&gt;
&lt;BR /&gt;
    Dim VBEModel As Object&lt;BR /&gt;
    Dim newRoutine As String&lt;BR /&gt;
&lt;BR /&gt;
    Set VBEModel = VBE  ' Get the VBE object&lt;BR /&gt;
&lt;BR /&gt;
    ' Define new subroutine to be added. This could be created dynamically&lt;BR /&gt;
from user feedback.&lt;BR /&gt;
    newRoutine = "Sub Dynamic_Procedure()" &amp;amp; vbCrLf&lt;BR /&gt;
    newRoutine = newRoutine &amp;amp; vbTab &amp;amp; "MsgBox ""New subroutine.""" &amp;amp; vbCrLf&lt;BR /&gt;
    newRoutine = newRoutine &amp;amp; "End Sub" &amp;amp; vbCrLf&lt;BR /&gt;
&lt;BR /&gt;
    ' Insert new subroutine&lt;BR /&gt;
    VBEModel.CodePanes(1).CodeModule.InsertLines 1, newRoutine&lt;BR /&gt;
&lt;BR /&gt;
    MsgBox "A new subroutine was added called Dynamic_Procedure."&lt;BR /&gt;
End Sub</description>
      <pubDate>Wed, 21 May 2008 19:42:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/save-vba-in-dvb-during-run-time-to-keep-key-in-data/m-p/2260287#M19699</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-21T19:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: Save VBA in .dvb during run time to keep key in data</title>
      <link>https://forums.autodesk.com/t5/vba-forum/save-vba-in-dvb-during-run-time-to-keep-key-in-data/m-p/2260288#M19700</link>
      <description>My scenario is.. I'd made a user data with default value 0 for textbox or ..value=false for checkbox &amp;amp; optionbutton. Actually my requirement is very simple. User will open original project with default value then they will key in such dimension of object then click commandbutton to draw object base on their input.. To complete complete drawing, user have to key in alot of data. It is important to us to keep all key in data or checkbox or option button to keep track &amp;amp; not to redo &amp;amp; redo it again.&lt;BR /&gt;
&lt;BR /&gt;
I'm trying to attach one of the file but warned error.&lt;BR /&gt;
&lt;BR /&gt;
I'm using just a simple autocad vba. A lot of recommended code did'nt explore.&lt;BR /&gt;
&lt;BR /&gt;
anyway.. thanks you guys for your feedback.</description>
      <pubDate>Thu, 22 May 2008 00:17:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/save-vba-in-dvb-during-run-time-to-keep-key-in-data/m-p/2260288#M19700</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-22T00:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Save VBA in .dvb during run time to keep key in data</title>
      <link>https://forums.autodesk.com/t5/vba-forum/save-vba-in-dvb-during-run-time-to-keep-key-in-data/m-p/2260289#M19701</link>
      <description>Check out "SaveSetting" &amp;amp; "GetSetting" in VBA help. There is sample code for&lt;BR /&gt;
both in help. They work well for setting up defaults on a given machine.&lt;BR /&gt;
&lt;BR /&gt;
Gary</description>
      <pubDate>Thu, 22 May 2008 10:48:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/save-vba-in-dvb-during-run-time-to-keep-key-in-data/m-p/2260289#M19701</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-22T10:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: Save VBA in .dvb during run time to keep key in data</title>
      <link>https://forums.autodesk.com/t5/vba-forum/save-vba-in-dvb-during-run-time-to-keep-key-in-data/m-p/2260290#M19702</link>
      <description>This is what I use to save userform info:&lt;BR /&gt;
'add this to a command button&lt;BR /&gt;
Dim ctl As Control&lt;BR /&gt;
For Each ctl In Controls&lt;BR /&gt;
' Next line skips certain controls.&lt;BR /&gt;
        Select Case TypeName(ctl)&lt;BR /&gt;
            Case "PictureBox", "Image", _&lt;BR /&gt;
                "Line", "Shape", "Timer", _&lt;BR /&gt;
                "CommandButton", "Label"&lt;BR /&gt;
            Case Else&lt;BR /&gt;
                ' Saves the control's value to the registry.&lt;BR /&gt;
                SaveSetting "SaveFormSettings", _&lt;BR /&gt;
                    "Values", ControlName(ctl), ctl&lt;BR /&gt;
        End Select&lt;BR /&gt;
    Next ctl&lt;BR /&gt;
&lt;BR /&gt;
Then use GetSetting to read the data as Gary McMaster suggested.  I read GetSetting at UserForm_Initialize.&lt;BR /&gt;
&lt;BR /&gt;
www(dot)DwgToolbox(dot)com</description>
      <pubDate>Thu, 22 May 2008 15:00:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/save-vba-in-dvb-during-run-time-to-keep-key-in-data/m-p/2260290#M19702</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-22T15:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: Save VBA in .dvb during run time to keep key in data</title>
      <link>https://forums.autodesk.com/t5/vba-forum/save-vba-in-dvb-during-run-time-to-keep-key-in-data/m-p/2260291#M19703</link>
      <description>I FAILED TO figure it out about savesetting &amp;amp; getsetting as Gary or DwgToolBox advise. I see you all are far more advance than me. Could you guys please made example in my attach partial program ?? Pleaseee..  at least to keep One of the textboxes after run time.</description>
      <pubDate>Fri, 23 May 2008 01:22:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/save-vba-in-dvb-during-run-time-to-keep-key-in-data/m-p/2260291#M19703</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-23T01:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: Save VBA in .dvb during run time to keep key in data</title>
      <link>https://forums.autodesk.com/t5/vba-forum/save-vba-in-dvb-during-run-time-to-keep-key-in-data/m-p/2260292#M19704</link>
      <description>He..He..&lt;BR /&gt;
Maybe I ask too much from you guys. Anyway.. Thanks for all your support..</description>
      <pubDate>Mon, 26 May 2008 00:21:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/save-vba-in-dvb-during-run-time-to-keep-key-in-data/m-p/2260292#M19704</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-26T00:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Save VBA in .dvb during run time to keep key in data</title>
      <link>https://forums.autodesk.com/t5/vba-forum/save-vba-in-dvb-during-run-time-to-keep-key-in-data/m-p/2260293#M19705</link>
      <description>Paste the code below into the indicated subs of the .dvb you supplied. It&lt;BR /&gt;
will save the contents of first two text boxes to the registry each time the&lt;BR /&gt;
contents of the text boxes are updated. I chose the "AfterUpdate" event, it&lt;BR /&gt;
could be a different event if you like.&lt;BR /&gt;
&lt;BR /&gt;
The values that are saved to the registry will be loaded into the "TL" &amp;amp;&lt;BR /&gt;
"skh" text boxes each time the "Pvessel" form is activated. You could also&lt;BR /&gt;
choose a different way to do that ... maybe a "Refresh" button instead of&lt;BR /&gt;
"UserForm_Activate"&lt;BR /&gt;
&lt;BR /&gt;
I chose the following names for the "GetSetting" &amp;amp; "SaveSetting" functions.&lt;BR /&gt;
They can be almost anything. Use whatever makes the most sense to you or&lt;BR /&gt;
your successor.&lt;BR /&gt;
&lt;BR /&gt;
appname = "Pvessel_App"&lt;BR /&gt;
section = "SU_Defaults" (Startup defaults)&lt;BR /&gt;
key = The name of the textbox with "_Textbox" appended&lt;BR /&gt;
default = equals the values you had displayed on your form&lt;BR /&gt;
&lt;BR /&gt;
Private Sub UserForm_Activate()&lt;BR /&gt;
&lt;BR /&gt;
Me.TL.Text = GetSetting(appname:="Pvessel_App", section:="SU_Defaults",&lt;BR /&gt;
key:="TL_Textbox", Default:="1130")&lt;BR /&gt;
Me.skh.Text = GetSetting(appname:="Pvessel_App", section:="SU_Defaults",&lt;BR /&gt;
key:="skh_Textbox", Default:="1000")&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Private Sub TL_AfterUpdate()&lt;BR /&gt;
&lt;BR /&gt;
SaveSetting "Pvessel_App", "SU_Defaults", "TL_Textbox", Me.TL.Text&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Private Sub skh_AfterUpdate()&lt;BR /&gt;
&lt;BR /&gt;
SaveSetting "Pvessel_App", "SU_Defaults", "skh_Textbox", Me.skh.Text&lt;BR /&gt;
&lt;BR /&gt;
End Sub</description>
      <pubDate>Tue, 27 May 2008 16:15:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/save-vba-in-dvb-during-run-time-to-keep-key-in-data/m-p/2260293#M19705</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-27T16:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: Save VBA in .dvb during run time to keep key in data</title>
      <link>https://forums.autodesk.com/t5/vba-forum/save-vba-in-dvb-during-run-time-to-keep-key-in-data/m-p/2260294#M19706</link>
      <description>My Dear Mr. Gary..&lt;BR /&gt;
&lt;BR /&gt;
CHEERS!!!..&lt;BR /&gt;
This have solve one of My MAJOR problems.. What can I do to repay you.. Thank you very..very much..</description>
      <pubDate>Fri, 30 May 2008 01:38:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/save-vba-in-dvb-during-run-time-to-keep-key-in-data/m-p/2260294#M19706</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-30T01:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Save VBA in .dvb during run time to keep key in data</title>
      <link>https://forums.autodesk.com/t5/vba-forum/save-vba-in-dvb-during-run-time-to-keep-key-in-data/m-p/2260295#M19707</link>
      <description>You're welcome. Glad I could help.&lt;BR /&gt;
&lt;BR /&gt;
You should also investigate the "DeleteSetting" statement. It will allow you&lt;BR /&gt;
to clean up after yourself (the registry) if you decide to change&lt;BR /&gt;
Application names or Key names etc.&lt;BR /&gt;
&lt;BR /&gt;
There are also some pitfalls when coding inside of event handlers. Please&lt;BR /&gt;
see "Guidelines for Writing Event Handlers" in VBA help.&lt;BR /&gt;
&lt;BR /&gt;
As I mentioned, there are other events that may be better suited to your app&lt;BR /&gt;
than the "After_Update" event. "UserForm_Deactivate", for example, might be&lt;BR /&gt;
a better (faster) place to save your settings. You could write the settings&lt;BR /&gt;
all at once when the user is finished with the form instead of doing them&lt;BR /&gt;
one at a time as in "After_Update".&lt;BR /&gt;
&lt;BR /&gt;
Good luck.&lt;BR /&gt;
&lt;BR /&gt;
Gary</description>
      <pubDate>Fri, 30 May 2008 11:24:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/save-vba-in-dvb-during-run-time-to-keep-key-in-data/m-p/2260295#M19707</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-30T11:24:10Z</dc:date>
    </item>
  </channel>
</rss>

