Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Prevent editing in Web Browser
Message
From
22/12/2008 10:12:34
Mike Sue-Ping
Cambridge, Ontario, Canada
 
 
To
19/12/2008 15:47:26
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01368880
Message ID:
01369139
Views:
15
>>I've got a comma separated values file (csv) that opens in a webBrowser control hosted in a VFP9 form. It appears rendered as a spreadsheet (Excel) and is editable.
>>
>>How can I prevent the contents from being changed?
>>
>>I've tried to set the file as readonly, but, it does not help; the user can still edit the content.
>>
>>TIA
>>Mike
>
>
#define xlNoSelection                                     -4142
>
>oXLS = myWBControl.Object.Document
>oExcel = oXLS.Application
>oExcel.CommandBars("Standard").visible = .F.
>oExcel.CommandBars("Formatting").visible = .F.
>oExcel.ActiveWorkbook.ActiveSheet.EnableSelection = xlNoSelection
>oExcel.ActiveWorkbook.ActiveSheet.Protect(,,.T.,,.T.)
Cetin

Hi Cetin,

Thanks for the reply.

After I've called the browser's navigate2("file://somepath/some_csv_file.csv") method I've added your code suggestion by modifying "myWBControl" to my object name, When I run the code I receive a Program Error - "OLE error code 0x80020006: Unknown name." when the line containing oXLS.Application tires to execute. From the VFP debugger, I can see that the object oXLS does not have this method. Did I not do this correctly?

Mike
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform