Can anyone find what is wrong with the following?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Derek Richards

    Can anyone find what is wrong with the following?

    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,
    WriteResPasswor d, IgnoreReadOnlyR ecommended, 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.
  • Tom Ogilvy

    #2
    Re: Can anyone find what is wrong with the following?

    In vba, you would leave arguments blank in a comma separated list

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

    I don't know what the rules are for Javascript.

    --
    Regards,
    Tom Ogilvy



    "Derek Richards" <Derek2122001@y ahoo.com> wrote in message
    news:2d38b9ae.0 310240939.489f3 6ee@posting.goo gle.com...[color=blue]
    > 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,
    > WriteResPasswor d, IgnoreReadOnlyR ecommended, 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.[/color]


    Comment

    • VK

      #3
      Re: Can anyone find what is wrong with the following?

      What does it have to do with tea and China(with JavaScript and Web)?

      If you are looking for a JScript "hook" to VBA, you can do something
      like this:

      function openExcel() {
      var Excel = new ActiveXObject(" Excel.Applicati on");
      Excel.Visible = true;
      Excel.Applicati on.Workbooks.Op en("C:\\MyBook. xls");
      //...
      }
      It opens MyBook in the normal (read/write) mode like if you run it in
      the conventional way. Of cource it works with security warnings, only on
      Internet Explorer, and only on your own computer (or within a LAN, see
      second optional parameter of ActiveXObject).

      If you want to serve a book to Explorer over the Web, just use a regular
      link <a href="http://..../MyBook.xls"> Of course you cannot save changes
      back to server, but you can edit and save on your computer.





      Comment

      • Tim Williams

        #4
        Re: Can anyone find what is wrong with the following?

        Post the code you have that doesn't work....

        Tim



        "Derek Richards" <Derek2122001@y ahoo.com> wrote in message
        news:2d38b9ae.0 310240939.489f3 6ee@posting.goo gle.com...[color=blue]
        > 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,
        > WriteResPasswor d, IgnoreReadOnlyR ecommended, 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.[/color]


        Comment

        • Derek Richards

          #5
          Re: Can anyone find what is wrong with the following?

          Hi Tim, thanks.

          Here it is.

          e.Workbooks.Ope n(strFileName, null, false, null, null, null, true);

          However, the file is still opened in Read-Only. How strange it is! Any suggestions?



          "Tim Williams" <saxifrax@pacbe llremovethis.ne t> wrote in message news:<u1h2BgomD HA.1244@TK2MSFT NGP11.phx.gbl>. ..[color=blue]
          > Post the code you have that doesn't work....
          >
          > Tim
          >
          >
          >
          > "Derek Richards" <Derek2122001@y ahoo.com> wrote in message
          > news:2d38b9ae.0 310240939.489f3 6ee@posting.goo gle.com...[color=green]
          > > 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,
          > > WriteResPasswor d, IgnoreReadOnlyR ecommended, 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.[/color][/color]

          Comment

          • Derek Richards

            #6
            Re: Can anyone find what is wrong with the following?

            I can bet your file will be opened in Read-Only as was in my cases.


            "VK" <schools_ring@y ahoo.com> wrote in message news:<3f997afb$ 0$15705$9b622d9 e@news.freenet. de>...[color=blue]
            > What does it have to do with tea and China(with JavaScript and Web)?
            >
            > If you are looking for a JScript "hook" to VBA, you can do something
            > like this:
            >
            > function openExcel() {
            > var Excel = new ActiveXObject(" Excel.Applicati on");
            > Excel.Visible = true;
            > Excel.Applicati on.Workbooks.Op en("C:\\MyBook. xls");
            > //...
            > }
            > It opens MyBook in the normal (read/write) mode like if you run it in
            > the conventional way. Of cource it works with security warnings, only on
            > Internet Explorer, and only on your own computer (or within a LAN, see
            > second optional parameter of ActiveXObject).
            >
            > If you want to serve a book to Explorer over the Web, just use a regular
            > link <a href="http://..../MyBook.xls"> Of course you cannot save changes
            > back to server, but you can edit and save on your computer.[/color]

            Comment

            Working...