Forum Home
Press F1
 
Thread ID: 77863 2007-03-26 00:18:00 Excel Macro Parameter Error Chris8 (12038) Press F1
Post ID Timestamp Content User
535842 2007-03-26 00:18:00 I'm a novice at Visual Basic, and I'm trying to change my macro so that the Workbooks.Open command will open a file that is recommended as Read Only to allow the macro to update the file. As there are a number of files which update, I don't want to be sitting at my PC clicking "No" each time a file opens.

How do I get it to work. The function is as below.

Function Open(Filename As String, [UpdateLinks], [ReadOnly], [Format], [Password], [WriteResPassword], [IgnoreReadOnlyRecommended], [Origin], [Delimiter], [Editable], [Notify], [Converter], [AddToMru], [Local], [CorruptLoad])

Thanks
Chris8 (12038)
535843 2007-03-26 19:58:00 bump pctek (84)
535844 2007-03-27 02:03:00 Set the ignore [IgnoreReadOnlyRecommended] parameter to True. So would be something like

Workbooks.Open "File.xls", , , , , , True

Where file.xls is the name of your file.

Note you may also want to set the [UpdateLinks] parameter to update the file automatically too. From the vbhelp file here are your possible options:

0 - Doesn't update any references
1 - Updates external references but not remote references
2 - Updates remote references but not external references
3 - Updates both remote and external references

So for example if you want to update remote and external refs it would be:

Workbooks.Open "File.xls", 3, , , , , True

HTH
Dave
odyssey (4613)
1