dcsimg
Results 1 to 5 of 5

Thread: EXCEL VBA: How To: Developers Open Webpage "Read Only" ???

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2004
    Location
    Carlisle, PA
    Posts
    1,045

    Question EXCEL VBA: How To: Developers Open Webpage "Read Only" ???

    Esteemed Forum Participants and Lurkers:
    ===============================
    Excel 2003 VBA

    We have a few low-level web (intRAnet) document publishers in this group, and I would like to add a macro to a VBA program to open a completed page (with a large table of linked files) "Read Only". The page is served by a local machine where all of the files are available to the group as a networked drive. This means that if the file is opened in Internet Explorer, it can be also be saved ... but when IE writes the file back, it fouls up all of the links.

    * I can already use the "ShellExecute" API to open the Page URL (thanks to this forum, RobDog888, and others), but this doesn't seem to support "Read Only".

    * The path to Internet Explorer is different on different user's machines, which makes it difficult to open IE with parameters.

    * When ShellExecute opens the page, if "File > SaveAs" is selected, the default file selection may easily be to write the file back over itself which causes disasters.

    We need to figure out programmatically how to open the page for viewing, but prevent the file from getting scrogged with a file save. Thank you in advance for any and all comments, suggestions, and assistance.
    Blessings in abundance,
    All the Best,
    & ENJOY!

    Art . . . . Carlisle, PA . . USA

  2. #2
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,610

    Re: EXCEL VBA: How To: Developers Open Webpage "Read Only" ???

    What type of file is it that you don't want them to be able to Save back ?
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    May 2004
    Location
    Carlisle, PA
    Posts
    1,045

    Re: EXCEL VBA: How To: Developers Open Webpage "Read Only" ???

    It is a simple HTML page file .... myTableFile.htm
    Blessings in abundance,
    All the Best,
    & ENJOY!

    Art . . . . Carlisle, PA . . USA

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    24,849

    Re: EXCEL VBA: How To: Developers Open Webpage "Read Only" ???

    set the file attributes to read only
    or make the directory on the server read only
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    May 2004
    Location
    Carlisle, PA
    Posts
    1,045

    Re: EXCEL VBA: How To: Developers Open Webpage "Read Only" ???

    Thanks westconn1 ...

    I sort of figured that was going to be the approach. I can't mess with the folder ... it isn't mine. My VBA program writes the file to the shared drive before the user can view it, so I'll have to juggle the file attributes in the program. The process makes a renamed copy of the original, overwrites the original with an "Under Construction" page, updates the linked files, and then writes the newly created page. After that, the user can view it. I put a heavy warning in the Popup that enables the view ... it approximately says:

    You "Save" the file from the Browser ... you be (anatomically modified).

    Fun - fun - fun.
    Blessings in abundance,
    All the Best,
    & ENJOY!

    Art . . . . Carlisle, PA . . USA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width