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: 7
Default VBA to Reference a file when not logged in? unc address?

Hi all. I am using the Office 2000 package and I hav created some nifty
macros (With help from some of you wizards of course) But I am having
problems makeing them work while logged off.

wkbk A needs to access wkbk B and currently I am referencig it with code
something like this:

FilePath = "X:\folder1\Customer"

'change drive to FilePath
ChDrive FilePath

'change directory to FilePath
ChDir FilePath

DataDir = Dir("wkbk_B.xls")

'If the file does not exist then go to exitline
If Len(DataDir) = 0 Then GoTo exitline

CustDir = Dir("wkbk_C.xls")
'If the file does not exist then..
If Len(CustDir) = 0 Then GoTo exitline

This works fine when I am logged in but when I set up the task scheduler to
run this I am not logged in and it fails. I am pretty sure it is failing
because the "X" drive is not mapped while I am not logged in.

I have tried using the UNC address in place of the drive association but it
does not work.

Any other suggestions how I might reference and open file wkbk_B.xls ??

IXLINXL - not
 
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
Hyperlink to URL needs login even though I'm already logged in Mats Stenberg Excel Discussion (Misc queries) 0 January 27th 10 03:15 PM
Need to know how many users are logged in... Nicholas Excel Discussion (Misc queries) 3 January 13th 10 11:52 PM
Getting Logged in User Name in formula... Kedar Agarkar Excel Discussion (Misc queries) 9 October 30th 07 03:55 PM
How do you reference the logged on user name in excel? Taurus Excel Discussion (Misc queries) 2 January 24th 06 07:38 PM
Reference Row Address scain2004[_14_] Excel Programming 2 May 28th 04 09:38 PM


All times are GMT +1. The time now is 07:16 PM.

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

About Us

"It's about Microsoft Excel"