Is there an Excel only Viewer which does not load and show the full Excel software
but only a viewer. This veiwer should allow the user to enter values in prepared cells
and select drop down values but does not offer all the huge functionality.
Particularly it should hide all the menues and toolbars of Excel.
Is there such a viewer only ?
Jeff
There is no "runtime" Excel only.
The Excel Viewer allows viewing and printing, but no editing.
Gord Dibben MS Excel MVP
"Jeff Korn" <un...@lycos.co.uk> wrote in message
news:475c0b22$0$17528$9b4e...@newsspool4.arcor-online.net...
--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)
"Jeff Korn" <un...@lycos.co.uk> wrote in message
news:475c296e$0$13107$9b4e...@newsspool2.arcor-online.net...
If the user does have Excel installed, you can use macros and cell
protection to lock it down. Here's an example of something I call in
Workbook_Open and Workbook_BeforeClose events. It makes a list of all
command bars and controls in a separate, hidden sheet. Then, it hides
and disables each one. It also disables basic cut/copy/paste
functionality. It provides the Ctrl+9 keyboard shortcut to "unlock"
the excel environment when necessary.
Public Sub LockdownExcel()
Dim objTemp As Object
Dim cbBar As CommandBar
Dim ctrl As CommandBarControl
Dim cbarCount As Integer
Dim ctrlCount As Integer
'disable keys and change settings
With Application
.ScreenUpdating = False
.DisplayAlerts = False
.Visible = False
.OnKey "^X", ""
.OnKey "^x", ""
.OnKey "^C", ""
.OnKey "^c", ""
.OnKey "^V", ""
.OnKey "^v", ""
.OnKey "^9", "ThisWorkbook.UnlockExcel"
.CutCopyMode = False
.DisplayStatusBar = False
.DisplayFormulaBar = False
.IgnoreRemoteRequests = True
.ActiveWindow.DisplayHeadings = False
.ActiveWindow.DisplayWorkbookTabs = False
.WindowState = xlMaximized
.ActiveWindow.WindowState = xlMaximized
.EnableEvents = False
.CommandBars.DisableAskAQuestionDropdown = True
.CommandBars.DisableCustomize = True
cbarCount = 0
On Error Resume Next
For Each cbBar In .CommandBars
If cbBar.Visible Then
cbarCount = cbarCount + 1
Worksheets("CommandBars").Cells(cbarCount, 1).Value =
cbBar.Name
cbBar.Visible = False
cbBar.Enabled = False
End If
Next cbBar
ctrlCount = 0
For Each ctrl In .CommandBars.ActiveMenuBar.Controls
If ctrl.Visible Then
ctrlCount = ctrlCount + 1
Worksheets("CommandBars").Cells(ctrlCount, 3).Value =
ctrl.Index
ctrl.Visible = False
ctrl.Enabled = False
End If
Next ctrl
On Error GoTo 0
.DisplayAlerts = True
.ScreenUpdating = True
.Visible = True
.EnableEvents = True
End With
excelLocked = True
End Sub
Public Sub UnlockExcel()
Dim cbBar As CommandBar
Dim cbarCount As Integer, cbarTotal As Integer
Dim ctrl As Control
Dim ctrlCount As Integer, ctrlTotal As Integer
'restore command bars
With Worksheets("CommandBars")
cbarTotal = CInt(.Cells(1, 2).Value)
ctrlTotal = CInt(.Cells(1, 4).Value)
On Error Resume Next
For ctrlCount = 1 To ctrlTotal
Application.CommandBars.ActiveMenuBar.Controls(.Cells(ctrlCount,
3).Value).Enabled = True
Application.CommandBars.ActiveMenuBar.Controls(.Cells(ctrlCount,
3).Value).Visible = True
.Cells(ctrlCount, 3).Value = ""
Next ctrlCount
For cbarCount = 1 To cbarTotal
Application.CommandBars(.Cells(cbarCount,
1).Value).Enabled = True
Application.CommandBars(.Cells(cbarCount,
1).Value).Visible = True
.Cells(cbarCount, 1).Value = ""
Next cbarCount
On Error GoTo 0
End With
'restore shortcut keys and other settings
With Application
.CommandBars.DisableAskAQuestionDropdown = False
.CommandBars.DisableCustomize = False
.OnKey "^X"
.OnKey "^x"
.OnKey "^C"
.OnKey "^c"
.OnKey "^V"
.OnKey "^v"
.OnKey "^9", "ThisWorkbook.LockdownExcel"
.CutCopyMode = xlCopy
.DisplayStatusBar = True
.DisplayFormulaBar = True
.IgnoreRemoteRequests = False
.ActiveWindow.DisplayHeadings = True
.ActiveWindow.DisplayWorkbookTabs = True
End With
excelLocked = False
End Sub
Private Sub Workbook_Open()
With Application
.OnKey "^V", ""
.OnKey "^v", ""
.OnKey "^c", ""
.OnKey "^C", ""
.OnKey "^x", ""
.OnKey "^X", ""
.OnKey "^{DEL}", ""
.OnKey "^{DELETE}", ""
.OnKey "^{INSERT}", ""
.OnKey "+{DEL}", ""
.OnKey "+{DELETE}", ""
.OnKey "+{INSERT}", ""
With .CommandBars("Cell")
.Controls("Copy").Enabled = False
.Controls("Cut").Enabled = False
.Controls("Paste").Enabled = False
.Controls("Paste Special...").Enabled = False
End With
With .CommandBars("Column")
.Controls("Copy").Enabled = False
.Controls("Cut").Enabled = False
.Controls("Paste").Enabled = False
.Controls("Paste Special...").Enabled = False
End With
With .CommandBars("Row")
.Controls("Copy").Enabled = False
.Controls("Cut").Enabled = False
.Controls("Paste").Enabled = False
.Controls("Paste Special...").Enabled = False
End With
With .CommandBars("Edit")
.Controls("Copy").Enabled = False
.Controls("Cut").Enabled = False
.Controls("Paste").Enabled = False
.Controls("Paste Special...").Enabled = False
End With
With .CommandBars("Standard")
.Controls("Copy").Enabled = False
.Controls("Cut").Enabled = False
.Controls("Paste").Enabled = False
End With
End With
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
With Application
.OnKey "^V"
.OnKey "^v"
.OnKey "^c"
.OnKey "^C"
.OnKey "^x"
.OnKey "^X"
.OnKey "^{DEL}"
.OnKey "^{DELETE}"
.OnKey "^{INSERT}"
.OnKey "+{DEL}"
.OnKey "+{DELETE}"
.OnKey "+{INSERT}"
.CommandBars("Cell").Enabled = True
.CommandBars("Row").Enabled = True
.CommandBars("Column").Enabled = True
With .CommandBars("Edit")
.Controls("Copy").Enabled = True
.Controls("Cut").Enabled = True
.Controls("Paste").Enabled = True
.Controls("Paste Special...").Enabled = True
End With
With .CommandBars("Standard")
.Controls("Copy").Enabled = True
.Controls("Cut").Enabled = True
.Controls("Paste").Enabled = True
End With
With .CommandBars("Cell")
.Controls("Copy").Enabled = True
.Controls("Cut").Enabled = True
.Controls("Paste").Enabled = True
.Controls("Paste Special...").Enabled = True
End With
With .CommandBars("Column")
.Controls("Copy").Enabled = True
.Controls("Cut").Enabled = True
.Controls("Paste").Enabled = True
.Controls("Paste Special...").Enabled = True
End With
With .CommandBars("Row")
.Controls("Copy").Enabled = True
.Controls("Cut").Enabled = True
.Controls("Paste").Enabled = True
.Controls("Paste Special...").Enabled = True
End With
End With
End Sub
On Dec 9, 12:44 pm, un...@lycos.co.uk (Jeff Korn) wrote: