+ Reply to Thread
Results 1 to 5 of 5

Opening an excel workbook in VBS Script

  1. #1
    Registered User
    Join Date
    06-14-2014
    Posts
    62

    Opening an excel workbook in VBS Script

    When seeing codes online that show you how to execute a macro in an excel workbook through the use of a vbs script, what does the 0 and true mean when opening the workbook?

    Please Login or Register  to view this content.
    Last edited by mp3909; 02-14-2019 at 07:20 AM.

  2. #2
    Registered User
    Join Date
    06-14-2014
    Posts
    62

    Re: Opening an excel workbook in VBS Script

    titled amended

  3. #3
    Forum Expert
    Join Date
    08-13-2008
    Location
    UK
    MS-Off Ver
    2010 primarily
    Posts
    2,001

    Re: Opening an excel workbook in VBS Script

    The first three arguments to the Open method are:
    Filename - obviously the file name
    UpdateLinks - either 0 (external links don't update) or 3 (they do update)
    Readonly - True to open it read-only.
    Rory
    If a job's worth doing, it's worth doing right
    over your shoulder by your boss

  4. #4
    Valued Forum Contributor
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    2016
    Posts
    735

    Re: Opening an excel workbook in VBS Script

    Select the "workbook.open" text, press F1 and an extended helppage will open.. it will explain more than we can do for you here.

    Also good to know
    while in the vba editor you can use CTRL + I to see Quickinfo on open part and which parts are needed in the formula or use CTRL+J will show a list of available properties or methods.
    That will explain what 0 or True does
    in General 0 is often the same as False and 1 is often the same as True, you can use eighter. the quickinfo or F1 helppage will show you what is set as true or false.


    for this case.

    expression. Open( _FileName_ , _UpdateLinks_ , _ReadOnly_ , _Format_ , _Password_ , _WriteResPassword_ , _IgnoreReadOnlyRecommended_ , _Origin_ , _Delimiter_ , _Editable_ , _Notify_ , _Converter_ , _AddToMru_ , _Local_ , _CorruptLoad_ )

    Filename: "C:\Desktop\Book1.xlsm"
    Updatelinks: 0 = false (links to other workbooks will not be updated automaticly on opening, this is recommended to avoid errorvalues)
    ReadOnly: True, so the file can not be saved under the same name,

    Greyed out parameters are not set in this case

  5. #5
    Registered User
    Join Date
    06-14-2014
    Posts
    62

    Re: Opening an excel workbook in VBS Script

    cheers guys, makes sense!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1