A
Al
I have a command button on a form that can open an excel
spread sheet file. I am doing this using the following code:
****************************************
Public Function UpdateLinks()
Dim Myfrm
Dim XL As Excel.Workbook, FName As String, strFlowchecker
As String, strFile As String
Dim RemoveButton As String
strFlowchecker = "FlowChekOpener.xls"
strFile = [Forms]![frmBloodTestsMain]![FileName]
Call Shell("""C:\Program Files\Microsoft
Office\Office\EXCEL.EXE"" /automation", 1)
Set XL = GetObject(strPath & strFile,
"Excel.Sheet")
XL.Application.Visible = True 'Make Excel Visible.
XL.Application.Windows(strFile).Visible = True
'Make the Workbook visible.
Set XL = GetObject(strPathFC & strFlowchecker,
"Excel.Sheet")
XL.Application.Windows(strFlowchecker).Visible
= False
'XL.Application.Run "RemoveButton"
End Function
*******************************************
My question is, How can I open Excel file as read only?
thanks
Al
spread sheet file. I am doing this using the following code:
****************************************
Public Function UpdateLinks()
Dim Myfrm
Dim XL As Excel.Workbook, FName As String, strFlowchecker
As String, strFile As String
Dim RemoveButton As String
strFlowchecker = "FlowChekOpener.xls"
strFile = [Forms]![frmBloodTestsMain]![FileName]
Call Shell("""C:\Program Files\Microsoft
Office\Office\EXCEL.EXE"" /automation", 1)
Set XL = GetObject(strPath & strFile,
"Excel.Sheet")
XL.Application.Visible = True 'Make Excel Visible.
XL.Application.Windows(strFile).Visible = True
'Make the Workbook visible.
Set XL = GetObject(strPathFC & strFlowchecker,
"Excel.Sheet")
XL.Application.Windows(strFlowchecker).Visible
= False
'XL.Application.Run "RemoveButton"
End Function
*******************************************
My question is, How can I open Excel file as read only?
thanks
Al