Excel is what we do best
ALL YOUR EXCEL NEEDS
FREE Excel STUFF
Excel Newsletter
Advanced Search Search Excel Content
PRODUCTS
Development
Contact Us
Learn how to create Excel dashboards.

Ozgrid Excel Newsletter. Excel Newsletter Archives  

Excel Tips | EXCEL VBA TIPS

Win a free copy of Professional Excel Development

A brief overview of Microsoft � Excel vulnerabilities

We have 2 great HALF-PRICE (Offer end Aug 31 09) specials to compliment this article from DataSafeXl

  1. VBA Safe To Encrypt VBA Code
  2. XLSAFE To Secure Excel Distribution

In this article, we will provide you with a brief overview of the Microsoft � Excel security environment and examine in more detail the effectiveness of Microsoft � Excel's built-in protection features. Read more article like this on DataSafeXL's site.

Undoubtedly, Microsoft � Excel's security environment can prove to be cumbersome even for experienced users. In addition, there are numerous methods which an intruder can use to bypass any security aspect of the Microsoft � Excel application. Without a doubt, the general consensus is that Microsoft � Excel's security environment is weak.


The following protection measures can be employed in a Microsoft � Excel spreadsheet:

Password to open the workbook
Password to protect sheet contents
Password to protect workbook structure
Password to protect VBA code

By using a password to open a Microsoft � Excel file, you are effectively encrypting its contents. Thus, only individuals who know this password can access any of the workbook's contents.

Even so, the default encryption standard in the Microsoft � Excel application is very weak and commercial password crackers can be used to obtain the password and access the contents of the file.

In addition, there is nothing that prevents a user from sharing the password with other individuals.

Subsequently, a spreadsheet developer can decide to protect the sheet contents and workbook structure so that users cannot change any formulae or the names of the sheets for example. Again, third party utilities exist which can bypass these protection features within seconds.

The abovementioned utilities can also be easily used to break the password for VBA projects and obtain access to the VBA source code.

Another common technique that Microsoft � Excel developers like to use, is to hide all sheets when the Excel file is closed. This method forces the user to 'Enable Macros' when opening a file, in order to be able to view the hidden sheets.

However, the pitfall with this approach is that users can still open the Excel file by 'Disabling Macros' and use an 'Add-in' to unhide and manipulate all sheets presented in the workbook.

To summarize, users can obtain and modify all the data in a workbook, even in situations where they are required to use a password to access a Microsoft � Excel file.

This is why DataSafeXL's innovative product and services are imperative for your business and your sensitive data.  Read more article like this on DataSafeXL's site.

We have 2 great HALF-PRICE (Offer end Aug 31 09) specials to compliment this article from DataSafeXl

  1. VBA Safe To Encrypt VBA Code
  2. XLSAFE To Secure Excel Distribution

Excel VBA Macro Codes

Working With Excel Worksheets In VBA Macro Code

See Also Add Worksheets || Add Worksheets in Month Order || Add Sheets in Numeric Order || Sort Excel Sheets/Worksheets || How To Reference Sheets || Delete Sheet Event Code || Run VBA Macro Code On Protected Sheets || Unprotect Or Protect Sheets In One Go || Group/Sort Sheets By Tab Color || Hiding Sheets In Excel || Loop All Worksheets/Sheets in Workbook & Apply Code || Return Sheet Tab Name To Cell || Create an Index Of All Sheets || View Multiple Sheets In One Window || Email Sheets

The Macros below show us multiple ways to have our VBA Macro Code apply to specific Worksheets. Copy code into any standard Module in the Excel VBE.

'''''''''''''''''''''''''''
''WORKING WITH WORKSHEETS''
'''''''''''''''''''''''''''

Sub SelectedWorksheets()
'http://www.ozgrid.com/VBA/excel-vba-sheet-names.htm
Dim ws As Worksheet

    For Each ws In ActiveWindow.SelectedSheets
        With ws
        
            'With Code Here
        
        End With
    Next ws
End Sub



Sub work
sheetsByCodeName()
'http://www.ozgrid.com/VBA/excel-vba-sheet-names.htm
Dim ws As Worksheet

    For Each ws In Worksheets
        'Select case is case sensitive
        Select Case UCase(ws.CodeName)
        'http://www.ozgrid.com/VBA/select-case.htm
           Case "SHEET1", "SHEET3", "SHEET5" 'ect
                With ws
            
                    'With Code Here
            
                End With
           'Optional use when most sheets are to be used
           'In this case, use "Case" to name sheets to be NOT used
           Case Else
                With ws
        
                    'With Code Here
        
                End With
     End Select
     
    Next ws
End Sub


Sub work
sheetsByName()
Dim ws As Worksheet
'http://www.ozgrid.com/VBA/excel-vba-sheet-names.htm
    For Each ws In Worksheets
        'Select case is case sensitive
        'http://www.ozgrid.com/VBA/select-case.htm
        Select Case UCase(ws.Name)
           Case "SHEET1", "SHEET3", "SHEET5" 'ect
                With ws
            
                    'With Code Here
            
                End With
           'Optional use when most sheets are to be used
           'In this case, use "Case" to name sheets to be NOT used
           Case Else
                With ws
        
                    'With Code Here
        
                End With
     End Select
     
    Next ws
End Sub


Sub work
sheetsByNamingConvention()
Dim ws As Worksheet
'http://www.ozgrid.com/VBA/excel-vba-sheet-names.htm
    For Each ws In Worksheets
    
       If ws.Name Like "Data*" Then
                With ws
            
                    'With Code Here
            
                End With
       End If
     
    Next ws
End Sub

Excel Dashboard Reports & Excel Dashboard Charts 50% Off

Become an ExcelUser Affiliate & Earn Money

Special! Free Choice of Complete Excel Training Course OR Excel Add-ins Collection on all purchases totaling over $64.00. ALL purchases totaling over $150.00 gets you BOTH! Purchases MUST be made via this site. Send payment proof to [email protected] 31 days after purchase date.

Microsoft � and Microsoft Excel � are registered trademarks of Microsoft Corporation. OzGrid is in no way associated with Microsoft