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.
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.
titled amended
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
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
cheers guys, makes sense!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks