Store InputBox value somewhere in the applcation

Store InputBox value somewhere in the applcation

rcolon9E4ZX
Advocate Advocate
191 Views
2 Replies
Message 1 of 3

Store InputBox value somewhere in the applcation

rcolon9E4ZX
Advocate
Advocate

Hello,

 

I have a macro for importing CAD files. I have an inputbox where I ask the user to specify the manufacturer. I am trying to store this MFG for the next time the macro runs. I am trying a global variable, but after the program quits, the next time it runs the global is cleared.

 

Public LastStrMFG 'global
.......
'Specify the manufacturer
Dim strMFG As String
strMFG = InputBox("Who is the manufacturer? Leave blank if saving outside of Purch.", "Specify manufacturer", LastStrMFG)
'Here is where I want to store the input for the next execution
LastStrMFG = strMFG

 

I have gotten around this in the past by storing/recalling values in a file. This is more complicated than I want to do for what could simply be a retained value stored somewhere in the project. How do I do this? There are several spots where I could use this functionality.

 

Any help would be appreciated. Thanks.

 

Rafael

 

0 Likes
192 Views
2 Replies
Replies (2)
Message 2 of 3

bradeneuropeArthur
Mentor
Mentor
With a add in this is easier to do then with ilogic and vba.
For ilogic and vba I would use a text file and read and write the manufacturer name....

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 3

frederic.vandenplas
Collaborator
Collaborator

You can use the registry to store your values.

https://stackoverflow.com/questions/1250455/read-and-write-to-the-registry-with-vb-net

 

If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"
0 Likes