Javascript required
Skip to content Skip to sidebar Skip to footer

Vb.net Open Write to Excel File Not Read Only

  1. #1

    cswaroopsaha is offline

    Thread Starter

    Inferior Fellow member



  2. #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.


  3. #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


  4. #4

    Re: Open excel file in read only fashion

    VB Code:

                            
    1. Dim oApp As Excel.Application

    2. Set oApp = New Excel.Application

    3. oApp.Workbooks.Open Filename:="C:\MyFile.xls", ReadOny:=True

    Ps, Congrats Shuja Ali on your 700 posts!

    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 AssembliesVB/Office Guru� Word SpellChecker�.InternetVB/Office Guru� Word SpellChecker� VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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


  5. #5

    Re: Open excel file in read only mode

    Quote Originally Posted past RobDog888

    Ps, Congrats Shuja Ali on your 700 posts!

    Thanks

    Use [code] source lawmaking here [/lawmaking] tags when yous post source code.

    My Articles


  6. #half dozen

    cswaroopsaha is offline

    Thread Starter

    Inferior Member


    Resolved Re: Open excel file in read but mode


  7. #7

    Re: Open excel file in read only mode

    Quote Originally Posted by cswaroopsaha

    Thanks a lot.....
    This helped me over again..

    If this is resolved, please pull down the Thread Tools menu and click the Mark Thread Resolved button. That volition permit everyone know that you have your answer.

    Cheers.


tebbutttrupoin.blogspot.com

Source: https://www.vbforums.com/showthread.php?396123-RESOLVED-Open-excel-file-in-read-only-mode