• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1330
  • Last Modified:

VBA to DLL

Hello,

      Is there any way to convert VBA to DLL quickly? Thanks in advance.
0
homerWS
Asked:
homerWS
  • 4
  • 4
  • 2
1 Solution
 
softplusCommented:
Hi Homer
quickly: depends on how quick you can code :). You can't convert it 1:1, but most of the objects are available (indirectly at least) and the code is almost the same. Depending on the size of the VBA-Scripts it should be more or less a matter of copy + paste + cleanup afterwards. But: there are many things you can do much better in VB directly which could be re-coded to run cleaner / faster. If it's small, why not paste it into a 500'er question - I'm sure some of the experts would jump at it and do it for you :)
John
0
 
homerWSAuthor Commented:
Hi softplus,

        The problem is that my VBA code is really huge. Its got 24 worksheets, 18 modules and 6 forms. Worksheets and forms has lesser codes, about 300 lines average. But 80% of the modules has about 4000 lines average.
        Actually, with the DLL conversion, I am just trying to protect my codes from the user. Is there other way rather than DLL conversion? Thanks!
0
 
softplusCommented:
Hi
You might want to take a look at these links
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnofftalk/html/office11072002.asp - MSDN on converting VBA to VB.NET, lots of finger-work
and
http://discuss.joelonsoftware.com/default.asp?joel.3.41858.6 - Joel on the future of VBA (which looks dreary considering MS obsoleted VB6 and has based the rest on .NET)

Looking at those, I think in the medium term you should look at converting your code to VB.NET more or less (or at least get used to having to do that in the future some time ... :( )You never know when the next office-version will come out and I'm sure your users will be the first to jump on (at least mine do, even if - or because? - I tell them not to). Your's wouldn't be the only thing that breaks, but it would be a good idea to at least be on the way to .NET when that happens instead of being surprised. :)

What I would do in your situation would be to convert some key functions into a DLL. It wouldn't hurt if someone looked at your "boring standard code" as long as the interesting things are hidden in DLLs. This way you can also add some copy prevention code in the DLL, and at the same time convert step by step from VBA to VB/VB.NET.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
homerWSAuthor Commented:
Hi softplus,

          I have tried coding in .NET but they are mighty slow. I thought maybe its my desktop but when I tried on the latest laptop my company gave me it was not that bad but was still slow compared to VB6. Therefore, I am still not impressed by it.
          I haven't looked through the web pages, but I think I like the last paragraph about how you suggest tto convert some of the codes to the dll. I will look through the web pages and give yoy a shout back.

0
 
softplusCommented:
Strange, I found .NET quite fast -- but of course it is a much larger overhead than VB6 so memory size makes a big difference (so it's not for every PC :)).  Let me know if you need anything more :)
John
0
 
dmangCommented:
If you do not want the user to view the code, why not just put a password on the macro code?
0
 
softplusCommented:
How'd it go? :)
0
 
homerWSAuthor Commented:
dmang,

      Password protecting the macro code is "hackable" using some sort of password recovery software. I have seen it done before.
0
 
homerWSAuthor Commented:
Softplus,

        Sorry for the late reply. Anyway, thanks for the tip.

0
 
dmangCommented:
True enough...
How desperate is your intended user group to see what's under the covers?
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 4
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now