+ Reply to Thread
Results 1 to 5 of 5

Opening an excel workbook in VBS Script

  1. #1
    Forum Contributor
    Join Date
    06-14-2014
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    186

    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
    Forum Contributor
    Join Date
    06-14-2014
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    186

    Re: Opening an excel workbook in VBS Script

    titled amended

  3. #3
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent SAC
    Posts
    8,885

    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

  4. #4
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,482

    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
    Forum Contributor
    Join Date
    06-14-2014
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    186

    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)

Similar Threads

  1. script to run the macro from Vb script with out opening the excel file
    By chandanp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-27-2021, 03:33 AM
  2. Execute VB Script/ SAP Script from Excel
    By ramkrishna1111 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-23-2015, 01:54 PM
  3. calling the vb script from the shell script(unix platform)
    By chandanp in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-21-2014, 06:21 AM
  4. Integrating Mainframe emulator script with excel's vba script
    By Himanshu Mishra in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-07-2012, 10:30 AM
  5. Create VBA script to short, dedicated button in excel for script?
    By realized in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-01-2009, 11:54 PM
  6. Script that edits the text printed on the button that runs the script
    By petalred in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2008, 02:41 PM

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