Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
53 views1 page

DSS

This VBA code is executed when the workbook is opened, enabling specific Excel add-ins such as the Analysis Toolpak and Solver. It prompts the user to adjust their Excel security settings to allow access to the Visual Basic Project. Additionally, it makes the 'Welcome' worksheet visible while hiding all other worksheets and sets the application to full-screen mode.

Uploaded by

sami damtew
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views1 page

DSS

This VBA code is executed when the workbook is opened, enabling specific Excel add-ins such as the Analysis Toolpak and Solver. It prompts the user to adjust their Excel security settings to allow access to the Visual Basic Project. Additionally, it makes the 'Welcome' worksheet visible while hiding all other worksheets and sets the application to full-screen mode.

Uploaded by

sami damtew
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Rem Attribute VBA_ModuleType=VBADocumentModule

Option VBASupport 1
Private Sub Workbook_Open()
'change add ins in Excel window ... must know name of addin
AddIns("Analysis Toolpak").Installed = True
AddIns("Analysis Toolpak - VBA").Installed = True
AddIns("Solver Add-in").Installed = True

'change reference in VBE for Solver VBA code and/or Simulation/Analysis code
MsgBox "Please update your Excel security settings." & vbLf & vbLf & _
"Go to Tools > Macros > Security." & vbLf & vbLf & _
"Click the 'Trusted Sources' tab, and check 'Trust access to Visual Basic Project'. "

On Error Resume Next


ThisWorkbook.VBProject.References.AddFromFile Application.LibraryPath & "\Solver\Solver.xla"
ThisWorkbook.VBProject.References.AddFromFile Application.LibraryPath &
"\Analysis\ATPVBAEN.xla"

Worksheets("Welcome").Visible = True
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
If ws.Name <> "Welcome" Then
ws.Visible = False
End If
Next
Application.DisplayFullScreen = True
End Sub

You might also like