Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default programming vba in vb

Hi

I would like to know if it is possible to program my VBA code in VB.
For example I want to prgram something in range("a1"), but I want to do it
in VB and not in VBA. I want to do this for security purposes as Excel is
easy to crack.

Any solutions will be helpful.

Regards

Anthony


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default programming vba in vb

Anthony,

You can write your code as an ActiveX DLL callable by VBA
procedures, or you can write a COM Add-In, which too is an
ActiveX DLL that supports a special interface. Neither of these
approaches is trivial, but neither is terribly difficult if you
have a proficiency in VB programming.

You can't simply create an exe out of your VBA code.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"AAAAA" wrote in message
...
Hi

I would like to know if it is possible to program my VBA code

in VB.
For example I want to prgram something in range("a1"), but I

want to do it
in VB and not in VBA. I want to do this for security purposes

as Excel is
easy to crack.

Any solutions will be helpful.

Regards

Anthony




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default programming vba in vb

Yes, you can create an exe out of your VBA code.

I'm now doing it all the time in VB6. I've deleted my VBA
programs at work on my hard drive, and now just use these
executables that I created at home (of the VBA code). Bob
Phillips and others gave me some clues, and now it's
easy. Once you figure it out, you just call the specially
written subroutine in front of every VBA action. It's
flawless.

I suppose the next thing for me to do, is to learn about
writing the code as an ActiveX DLL. Care to share how
it's being done? I'd supply you with some "teasing" code,
but I'm at work and all this other code is at home.

Merry Christmas and Happy Holidays!!!

-----Original Message-----
Anthony,

You can write your code as an ActiveX DLL callable by VBA
procedures, or you can write a COM Add-In, which too is an
ActiveX DLL that supports a special interface. Neither of

these
approaches is trivial, but neither is terribly difficult

if you
have a proficiency in VB programming.

You can't simply create an exe out of your VBA code.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"AAAAA" wrote in message
...
Hi

I would like to know if it is possible to program my

VBA code
in VB.
For example I want to prgram something in range("a1"),

but I
want to do it
in VB and not in VBA. I want to do this for security

purposes
as Excel is
easy to crack.

Any solutions will be helpful.

Regards

Anthony




.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default programming vba in vb

Writing an activex.dll takes a little getting used to, but there is
plenty of help available. What you need to learn, mostly, is how to
create class modules. If you already know how to do that, all you need
to do is select the type of application to create when you start.

The most important part of writing class modules is the use of
properties, most of which should be "public" to be of any use. There
are two type of "procedures" that are used, a property "let" (which sets
the value of a private variable) and a property "get" (which retrieves
this value). You need to use a property "set" instead of a "let" if the
property is an object type.

A very much simplified class module might contain the following (note
that I am writing this from a friend's computer, without syntax
checking, so use it with care):

Private m_Color as integer

Public Property Get Color() as Integer
Color = m_Color

End Property

Public Property Let Color(ByVal vNewVal as Integer)
m_Color = vNewVal

End Property

If the above code was in a class module called "Crayon", you could use
it in an application like this, after compiling the DLL and setting a
reference to that file:

Dim xCrayon as New Crayon
Dim Xcolor as Integer

xCrayon.Color = 4 ' This executes the property "set"
Xcolor = xCrayon.Color ' Executes the property "get"

You can also use enums to set integer values to string constants.

Hope this helps, and happy holiday!!

Martin

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
programming help Stan Excel Discussion (Misc queries) 2 April 23rd 07 02:44 PM
CD Programming nelson Excel Discussion (Misc queries) 0 June 4th 06 04:32 PM
programming ernie Excel Discussion (Misc queries) 4 March 13th 06 02:06 PM
Programming help BB Excel Discussion (Misc queries) 3 December 5th 05 01:09 AM
Do I need programming for this? .NET Developer Excel Programming 2 August 18th 03 08:55 PM


All times are GMT +1. The time now is 09:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"