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.....
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" <h_boulder@gmx.at> wrote in message
news:1138155524.187845.34940@o13g2000cwo.googlegroups.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.....
>
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.....
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" <h_boulder@gmx.at> wrote in message
news:1138160125.756412.190760@z14g2000cwz.googlegroups.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.....
>
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
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.....
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
I almost forgot: webbrowser reference:
http://msdn.microsoft.com/library/de...reflist_vb.asp
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks