Help Please! Thanks in advance.

  • Thread starter Thread starter Derek Richards
  • Start date Start date
D

Derek Richards

The following syntax is what I found under the Help in Excel's VBA
Editor (you may refer to it for the details of each parameter). i
specified to open in Write
mode (Read Only is false), it doesn't do the way as I wished to open
in
Write mode. Instead, still saw (Read Only) above the MenuBar on the
upper
left corner when an excel file is opened.


Syntax

expression.Open(FileName, UpdateLinks, ReadOnly, Format, Password,
WriteResPassword, IgnoreReadOnlyRecommended, Origin, Delimiter,
Editable, Notify, Converter, AddToMRU)


Here I care nothing else but opening a file in Read & Write. How to
specify the parameters to open in Read & Write in javascript given the
syntax?

Thanks very much.
 
I suspect the file's readonly attribute is set - you will need to change
that using file io.
 
Oops! I meant how to change excel file's readonly attribute using file
IO. Any details? Thanks.
 
I am talking about changing the file attribute readonly. In VBA this would
be done using setattr

SetAttr "TESTFILE", vbNormal

Your open command gives the option of ignoring readonly recommended which
is Excel's method of making a file readonly.
 
Based on syntax

expression.Open(FileName, UpdateLinks, ReadOnly, Format,
Password, WriteResPassword, IgnoreReadOnlyRecommended,
Origin, Delimiter, Editable, Notify, Converter, AddToMRU)

I wrote in JavaScript.

e.Workbooks.Open(myFile, null, false, null, null, null,
true)

also i tried all kinds of combinations of true and false
in the entries in case the method was written wrong by
microsoft. It was always able to open excel files, but
always in read-only: saw (Read Only) above the MenuBar on
the upper left corner when an excel file is opened.
 
We are going in circles here. As I said, it sounds like you need to change
the file attribute of the file before you try to open it. This isn't done
with the Open command. You can also change IgnoreReadOnlyRecommended to
True, but I doubt this is the source since you have not been prompted.

Select the file in windows explorer and look at properties - I suggest that
the readonly property will be set. This is what you need to change.
 
Actually I double checked a few times (even before) to
make sure that the read-only attribute is NOT checked. It
seems that the open method in Javascript is the key here!

Do you have any suggestions? Thanks.
 
Back
Top