Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I've following situation: From a external VBE application (not MS) i open a excel file in a webbrowser. Of course it's possible now to edit th excel sheet. Is it possible to prevent modifications in the loaded excel sheet? i tried it with disabling the excel alert: webbrowser1.application.DisplayAlerts = false .... but it didnt work Thanks in advance..... |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
herb,
Don't know about the webbrowser control, but the OLE control can be set to Interactive=false. The OLE control takes a little get used to. NickHK "herb" wrote in message ups.com... Hello, I've following situation: From a external VBE application (not MS) i open a excel file in a webbrowser. Of course it's possible now to edit th excel sheet. Is it possible to prevent modifications in the loaded excel sheet? i tried it with disabling the excel alert: webbrowser1.application.DisplayAlerts = false ... but it didnt work Thanks in advance..... |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thanks for the reply....
i didn't work.... i've tried this: Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant) Set m_oDocument = pDisp.Document m_oDocument.Application.Interactive = False End Sub .... with the effect that nothing happens the problem is, that the data on the excel sheet are a kind of report, which of course should be not modified..... |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
herb,
No, the OLE control has a .Interactive property. I do not know about the webbrowser control. Do you have to use the webbrowser ? NickHK "herb" wrote in message oups.com... thanks for the reply.... i didn't work.... i've tried this: Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant) Set m_oDocument = pDisp.Document m_oDocument.Application.Interactive = False End Sub ... with the effect that nothing happens the problem is, that the data on the excel sheet are a kind of report, which of course should be not modified..... |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
if you have access to the excel file you may protect the workbook (and worksheets). If not, you may protect the workbook via automation. the workbook (or maybe worksheet) object should be accesible under the webbrowser1.document property hope this helps, fernando |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
fernando schrieb:
Hi, if you have access to the excel file you may protect the workbook (and worksheets). If not, you may protect the workbook via automation. the workbook (or maybe worksheet) object should be accesible under the webbrowser1.document property hope this helps, fernando hi, the webbrowser in vbe doesnt support webbrowser1.Interactive=false the reports are generated automatically from an application, so it is not possible to protect the worksheet while generated. is it possible to overlay an invisible window to the webbrowser? hmm.... i'm running out of ideas..... |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I checked the reference for the webbrowser control and I didn't find the property you want to use. I also have no idea what application you are using (VB6 / VBA, other?). Anyway, I hope the code below helps: 'just a Form and a WebBrowser control in VB6 / VBA Private Sub Form_Load() 'a reference to the excel object library must be declared Dim wb As Excel.Workbook Dim ws As Excel.Worksheet 'just open any excel file in the webbrowser control Me.WebBrowser1.Navigate "C:\Mis documentos\libro3.xls" ' change this file 'the document property in the WebBrowser control is the Excel.Workbook object Set wb = Me.WebBrowser1.Document 'once you have access to the Workbook object, you can do pretty much what you 'like, in this case: protecting the Worksheets 'loop through the worksheets and protect each For Each ws In wb.Worksheets ws.Protect Next Set ws = Nothing Set wb = Nothing End Sub |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hello fernando,
the problem was that the excel sheet should be protect before displaying. Private Sub Webbrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant) .... here the protection-procedure which you have mentioned... End Sub ....with this it works... thanks for you help, Herb |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
IF Statement Modifications | Excel Worksheet Functions | |||
Deny/Allow for certain range. | Excel Discussion (Misc queries) | |||
turn off excel cell modifications? | Excel Discussion (Misc queries) | |||
webbrowser - excel - modifications | Excel Discussion (Misc queries) | |||
Modifications to Permutation Macro | Excel Programming |