Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I package my Excel app?

Status
Not open for further replies.

j9

Programmer
Jun 6, 2001
90
US
This is probably very basic, but I've never had to do this before: What do I need to do to package my excel file into some kind of end-user format (e.g. prevent end users from viewing the code in the VB editor, etc.?). I found info for the VB Package and Deployment Wizard, but nothing for Excel. Thanks.
 
Assuming that the users are not allowed to do anything to the file other than say enter data, then you could remove the "record macros" and "macros" from the toolbar.

To do this, click on TOOLS->CUSTOMIZE

Then with the customize window open, click on TOOLS again. Click on Macro and then MACROS. Then drag this off the menu bar which should remove the entry.

Protect the worksheet/book and you should be OK!
 
I forgot to mention that the users will need to refresh the data ranges, but that's it--they cannot make any other changes to the spreadsheet. Anyway, I'll check out the different suggestions and see what I come up with.
 
OK-I'm trying the add-in thing per the suggestion above but I don't really understand what to do with the add-in once I create it. Note that I can 'lock project for viewing' without saving the workbook as an add-in. Thanks.
 
You can also lock the VB code down with a password. To do this right click on the project in VB editor, go to properties, click the protection tab, check lock project for viewing then enter your pw.
 
Yes, that's what I ended up doing. I found the VB lock procedure in the link above for creating an add-in. I didn't create an add-in, though, since I didn't understand that part of it. Anyway, it's working. So, I guess there's no Package and Deployment Wizard or anything like that for Excel since no one has mentioned it?

One quick note: I couldn't implement the worksheet protection suggestions since that prevents data range refreshes (because the cells become read-only).

Thanks to all for your help!
 
If you want to protect your formulas on your worksheet attach this code. You will also need to run it on the SelectionChange event for the worksheet you want to protect.

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

Run ProtectForm

End Sub

Function ProtectForm()

Dim col As Integer
Dim row As Integer

col = ActiveCell.column + 1
row = ActiveCell.row

If ActiveCell.HasFormula = True Then
Cells(row, col).Select
End If

Close col
Close row

End Function
 
J9,

I happened to notice your last note, and I have a solution for you.

Your note:

One quick note: I couldn't implement the worksheet protection suggestions since that prevents data range refreshes (because the cells become read-only).

My solution:

If your "data range refreshes" involve specific cells, simply highlight those cells and use Format - Cells - Protection, and un-check "Locked".

The important thing is to do the "un-Locking" FIRST, and THEN Protect the sheet - with Tools - Protect - Protect Sheet.

I hope this helps.

Regards, ...Dale Watson dwatson@bsi.gov.mb.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top