Results 1 to 6 of 6

Thread: Map network drive / file access

  1. #1

    Thread Starter
    Fanatic Member staticbob's Avatar
    Join Date
    Jan 2005
    Location
    Manchestershire, UK Cabbage: I do
    Posts
    619

    Map network drive / file access

    Guys,

    I am trying to open an excel template from an ASP page. I have identity impersonate set to true in web.config, the file I am trying to access is in the root folder of my website, and all users have access.

    When I try to open this file I am being asked for a logon, I want to get rid of this so it is seamless to the user.

    I was thinking, if there was a way of mapping a network drive on the server, with predefined account credentials, then I could access the file in code using "wkbk = xl.Workbooks.Open("z:\HPTResults.xlt")" rather then giving the full unc path ? Could that get round my login problem ?

    Thanks
    Bob

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Map network drive / file access

    Although I think my post in your other thread should eliminate this question, you could have a look at the NetworkCredentials class, but I am not 100% sure how this method would apply in this case.

    Yet another option you can look at is to have a local copy of the XLS file on your server and then write the file in a stream to the user.

  3. #3

    Thread Starter
    Fanatic Member staticbob's Avatar
    Join Date
    Jan 2005
    Location
    Manchestershire, UK Cabbage: I do
    Posts
    619

    Re: Map network drive / file access

    MH, could you give me some more info about the writing to a stream please mate, as that sounds like a good option.

    Cheers
    Bob

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Map network drive / file access

    Try out what I've posted in your other thread.

    What is "MH"?

  5. #5

    Thread Starter
    Fanatic Member staticbob's Avatar
    Join Date
    Jan 2005
    Location
    Manchestershire, UK Cabbage: I do
    Posts
    619

    Re: Map network drive / file access

    Sorry . . . mh, mendhak . . . MendHak . . .

    I'll try the jscript and let you know later.

    Cheers

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Map network drive / file access

    Ah, ok... I thought it was an odd variation of m8.

Posting Permissions

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



Click Here to Expand Forum to Full Width