LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Log-In Credentials in a Macro

I have an excel macro that accesses files on another computer over the
network (workgroup). I have shared this folder however when I run the
macro unless I access the other computer and enter the log in
credentials. Is there a way to hard code the log in credentials into
my code, so that it's not necessary to login if the computer is
restarted or another account logs on?

What I currently do now is goto Start=Run \\10.0.118.16 and enter the
credentials before I run the macro.

Below is a snap shot of the code that accesses the other computer







Set Res = Range("A1") 'upper left corner of Result range

Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder("\\10.0.118.16\DataFiles\")
Set fc = f.Files

i = 0

With Res

For Each fl In fc

If UCase(Right(fl.Path, 4)) = ".TXT" Then


Thanks


Little Penny
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I pass the logon credentials in a macro to a ODBC query Peter Cooling Excel Programming 1 January 14th 09 10:53 PM
Excel paste ask user credentials Surjeet Gill Excel Discussion (Misc queries) 0 November 12th 08 04:29 PM
Verifying your credentials for opening content with restricted pe. Arun Excel Discussion (Misc queries) 0 September 6th 06 03:41 PM
Can a service account be embedded in Workbook so that by default the macros are run with service account credentials and not the user credentials??? Divya Sanam Excel Discussion (Misc queries) 0 July 20th 06 05:15 PM
Using classes to store user credentials Philippe Pons Excel Programming 3 August 3rd 05 04:22 PM


All times are GMT +1. The time now is 08:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"