Author Topic: How can I manage by VBA macros behaviour through .NET?  (Read 2838 times)

0 Members and 1 Guest are viewing this topic.

Andrey Bushman

  • Swamp Rat
  • Posts: 864
How can I manage by VBA macros behaviour through .NET?
« on: March 12, 2013, 08:01:49 AM »
How can I manage by VBA macros behaviour through .NET?

Regards, Andrey.

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: How can I manage by VBA macros behaviour through .NET?
« Reply #1 on: March 12, 2013, 09:49:15 AM »
Some settings are exist in registry:
Code: [Select]
[HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R19.0\ACAD-B001:409\Profiles\<<Unnamed Profile>>\acadvba]
"AutoEmbedding"=dword:00000000
"AllowBreakOnErrors"=dword:00000001
"ShowSecurityDlg"=dword:00000001
But settings for disabling autoloading not exist.

Somebody knows the decision?

Keith Brown

  • Swamp Rat
  • Posts: 601
Re: How can I manage by VBA macros behaviour through .NET?
« Reply #2 on: March 12, 2013, 11:14:15 AM »
It might be possible that you can change that with .net but if you can then Autodesk would be retarded.  It would be an open invitation for software developers to embed malicious software into a dwg without the user being able to stop it.  This is the reason they added the ability to not run Autolisp automatically upon startup recently.  just my 2 cents.
Keith Brown | AutoCAD MEP Blog | RSS Feed
AutoCAD MEP 2014 / Revit MEP 2014 / EastCoast CAD/CAM addon / Visual Studio 2013

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: How can I manage by VBA macros behaviour through .NET?
« Reply #3 on: March 12, 2013, 12:17:14 PM »
This is the reason they added the ability to not run Autolisp automatically upon startup recently.
I think it was added by my ADN Case 06921325.
The same opportunity has to be and for VBA. Many of my users at first pressed the button and are think only after that. Therefore, I want to forbid starting of VBA of the macroses being in the drawing. We have the English AutoCAD version, but many users don't know this language. Many users press the button at random.

It would be an open invitation for software developers to embed malicious software into a dwg without the user being able to stop it.
Absolutely incorrectly. On the contrary, it allows to eliminate the danger.

Keith Brown

  • Swamp Rat
  • Posts: 601
Re: How can I manage by VBA macros behaviour through .NET?
« Reply #4 on: March 12, 2013, 01:47:09 PM »
I thought you were saying how could you disable the popup from appearing and automatically run the macro.  My mistake. 

You can automate selecting items on a form with Autoit at Autoitscript.com.  They have an activeX/com version that you can reference in your project that will allow you to automate dialogs.  I have never used it inside of autocad but it might be worth looking into for your application.

Keith Brown | AutoCAD MEP Blog | RSS Feed
AutoCAD MEP 2014 / Revit MEP 2014 / EastCoast CAD/CAM addon / Visual Studio 2013

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: How can I manage by VBA macros behaviour through .NET?
« Reply #5 on: March 13, 2013, 06:27:28 AM »
You can automate selecting items on a form with Autoit at Autoitscript.com.  They have an activeX/com version that you can reference in your project that will allow you to automate dialogs.  I have never used it inside of autocad but it might be worth looking into for your application.
Thanks for the response, but it doesn't suit. I want to do it through the .net.

Keith Brown

  • Swamp Rat
  • Posts: 601
Re: How can I manage by VBA macros behaviour through .NET?
« Reply #6 on: March 13, 2013, 10:12:55 AM »
When installing AutoIt it will install a AutoIt ActiveX dll that allows you to manipulate dialogs using .NET.  I know it is far from a perfect solution but it does work and it can be programmed using .net.  The only downside I believe is that the AutoIt dll needs to be registered on each users machine.  This was not a downside for me as I am the only one currently using the program that I created with it but I can see where it would not be a good idea if there were many users that needed to use the solution.
Keith Brown | AutoCAD MEP Blog | RSS Feed
AutoCAD MEP 2014 / Revit MEP 2014 / EastCoast CAD/CAM addon / Visual Studio 2013

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: How can I manage by VBA macros behaviour through .NET?
« Reply #7 on: March 13, 2013, 10:36:36 AM »
but I can see where it would not be a good idea if there were many users that needed to use the solution.
I have more than 200 users in our company.