protect Excel by making dll and exe files

cameron

New Member
Joined
Aug 12, 2002
Messages
18
I would like to protect my Excel projects (or at least the userforms) by making them dll or exe files in Visual Basic and then running them from within Excel.

The userform code references Worksheet(1).Range("A1"), etc so will this compile in vb as an exe or dll?

also, how do I execute the dll/exe from an Excel spreadsheet using the Sub Workbook_Open() procedure?

Cameron.
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Hi Cameron,

No idea about creating dll or exe files, but have you considered making your project into an Add-in?

Just a thought. :wink:
 
Upvote 0
Yes. but the code is still accessible by opening the .xla file.

I'm trying to guard against the chance of giving the working product to a client and them not paying me for it as they will be able to access all the source code (and then take out the code that says; "if NOW > #1/1/03# then application.quit"!!! which is my current safeguard against not getting paid).

Nice try tho....

I need to use CALL from within Excel to call a dll file but I'm not a VB programmer so don't really know where to start. VB6.0 comes up with a compile error as soon as it hits any code that mentions worksheets.
 
Upvote 0
cameron,

IF You plan to use Your work in 2000 or above a good solution would be to create a COM add-in with VB6 :)

Kind regards,
Dennis
 
Upvote 0
OK im no programmer but i can give the answer as my company sometimes do in MS VS [Visual Studio] you have VB and C++ and Java and so on, i think, do not have it,

Dll are compatable in C++
exe are VB6 or VB Net [.net]
And as Dennis [XL-Dennis] point out Coms are also VB6.

OK the best way is to get excel to write to the regisstry and have floating password in the documents, so you can hide stuff using line codes .hide and call the image userform or whatever from there.

BUT im no programmer, and yes i see this stuff everyday.

EXE calling is hard, dlls are fine locate them in windows for security as they wont look out of place there and name the dll as if its ment to be there so only a sha keep eye like mine wil say EH!!! thats not right will weed out the monkeys fast.

I hope thats some help.
 
Upvote 0
OK the best way is to get excel to write to the regisstry and have floating password in the documents, so you can hide stuff using line codes .hide and call the image userform or whatever from there.

ok, that sounds cool. could you give me a few hints about how to do that?

could I export txt to a .reg file and then execute that? or is there a better way?

Dennis - Am going to distribute on a mix on Excel97/2000/XP so can't use coms I guess.
 
Upvote 0
You can develop DLLs and EXEs using the pro/enterprise editions of Visual Basic, or the Developer version of VBA.

If your dll is going to reference sheets, cells, etc then you probably need to set a reference to the Excel library in your VB project.

Finally, there are decompilers that can be used to reverse engineer any dll that has been written in VB, so I am not sure that this route is any more secure than just locking your normal add-in project's VBA code with a password.

If a determined ******* has the know how to do this, then he probably has the know how to develop the app anyway :)
This message was edited by Swamp Thing on 2002-09-02 18:56
 
Upvote 0
ok. guess I'll have to set a long password and hope for the best.

have set it so if the program is run past a certain day it writes a file to disk which the program looks for on startup and quits if found. (just in case they were smart enough to set the date back a year in the hope the program would work again!!!)

And now I think it might be time to look for gainful employment elsewhere!

Thanks for all your help guys!

Cameron.
 
Upvote 0
You are right about the vulnerability of Add-Ins and Excel files in general. I can get into the source code of either with just a Hex Editor.

I've faced this problem as I have delved in commercial software built to run in Excel. The simplest thing to do seems to be to use an ActiveX dll if you want forms, etc. or a C++ dll if you simply want calculation speed. I have done both and once you learn the minute details it goes pretty fast. Although I have never built them, the COM Add-In route may be very promising. I have seen these used and they seem to be air-tight as far as security goes.

This is a great resource for writing C++ dlls for use in Excel:

http://www.che.utexas.edu/cache/newsletters/spring2001_useofc.pdf

I believe you can find info on ActiveX dlls all over the net.

Good luck,

Doug
 
Upvote 0

Forum statistics

Threads
1,214,561
Messages
6,120,242
Members
448,951
Latest member
jennlynn

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top