Vb.net Open Write to Excel File Not Read Only
-
Mar 30th, 2006,06:36 AM #1
Thread Starter
Inferior Fellow member
-
Mar 30th, 2006,06:58 AM #2
Re: Open excel file in read but mode
Why don't you change the file attributes to Read Simply before you open it? Or tin can't you modify file attributes in VBA?
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'one thousand no skillful, I'm still learning.
-
Mar 30th, 2006,07:08 AM #3
Re: Open excel file in read only style
The best way would exist to utilise Command Line switches. To open a file every bit Readonly you can apply
Code:
Excel.EXE /r myFile.xls
Utilise [code] source code here [/code] tags when you post source lawmaking.
My Articles
-
Mar 30th, 2006,07:11 AM #4
Re: Open excel file in read only fashion
VB Code:
-
Dim oApp As Excel.Application
-
Set oApp = New Excel.Application
-
oApp.Workbooks.Open Filename:="C:\MyFile.xls", ReadOny:=True
VB/Office Guru� (AKA: Gangsta Yoda� � )
I dont answer coding questions via PM. Please post a thread in the appropriate forum. Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.Net, VB half dozen, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a mail has helped yous then Please Charge per unit it!
� Reps & Rating Posts � VS.NET on Vista � Multiple .NET Framework Versions � Office Main Interop Assemblies � VB/Office Guru� Word SpellChecker�.Internet � VB/Office Guru� Word SpellChecker� VB6 � VB.NET Attributes Ex. � Outlook Global Address List � API Viewer utility � .Net API Viewer Utility �
Organisation: Intel i7 6850K, Geforce GTX1060, Samsung K.two ane TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
-
Mar 30th, 2006,07:fifteen AM #5
Re: Open excel file in read only mode
Originally Posted past RobDog888
Use [code] source lawmaking here [/lawmaking] tags when yous post source code.
My Articles
-
Mar 31st, 2006,12:33 PM #half dozen
Thread Starter
Inferior Member
Re: Open excel file in read but mode
-
Mar 31st, 2006,12:58 PM #7
Re: Open excel file in read only mode
Originally Posted by cswaroopsaha
Cheers.
Source: https://www.vbforums.com/showthread.php?396123-RESOLVED-Open-excel-file-in-read-only-mode