VBS open readonly recommended doc

sjk136

New Member
Joined
Jan 3, 2011
Messages
7
Hi,

This code does what I want so far. It will open the Workbook I want, will make it visible, and will run the module that I've specified.

The problem that I have, is that the WB is saved with Read Only Recommended on, so when I open the WB with the below VB script, it opens it as read only, and wont let me save. I want it to open as read-write instead.

I saw the IgnoreReadOnlyRecommended argument in the .Open documentation, but don't know how to implement it into a VBS.

Any ideas?

VBS code so far
Code:
Dim xlApp 
Set xlApp = CreateObject("Excel.Application")

 With xlApp
 xlApp.Workbooks.Open "blah" 
 ''.IgnoreReadOnlyRecommended = True
 .Visible = True
 .Application.Run "modBlah"
 .Application.Quit
 End With
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
It shows me an Expected Statement Error at line 5 char 32 (the "filename" argument I think) I think it doesn't like that formatting.

I then changed the next line to the one following it.

Code:
xlApp.Workbooks.Open "blah" 
xlApp.Workbooks.Open Filename:="blah"
and it still didn't like it.
 
Upvote 0

Forum statistics

Threads
1,214,976
Messages
6,122,539
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top