Help Please! Thanks in advance.

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.
 
T

Tom Ogilvy

I suspect the file's readonly attribute is set - you will need to change
that using file io.
 
D

Derek Richards

Oops! I meant how to change excel file's readonly attribute using file
IO. Any details? Thanks.
 
T

Tom Ogilvy

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.
 
D

Derek

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.
 
T

Tom Ogilvy

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.
 
D

Derek

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top