LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 276
Default Code to look at all sheets not just specified sheet ?

Thanks Tom.
Got the whole project up and running now.

Finally....

Thanks and thanks to ALL who assisted me with my constant posts over the
past weeks.

Corey....
"Tom Ogilvy" wrote in message
...
chdir doesn't work with the \\Servername format.

Previously posted by Rob Bovey:
' Placed at the top of a general module outside any procedures:
Private Declare Function SetCurrentDirectoryA Lib _
"kernel32" (ByVal lpPathName As String) As Long

Sub ChDirNet(szPath As String)
Dim lReturn As Long
lReturn = SetCurrentDirectoryA(szPath)
If lReturn = 0 Then Err.Raise vbObjectError + 1, "Error setting path."
End Sub


' sample usage


Sub FindFile()
ChDirNet "\\LOGD0FILES\OGILVTW\Docs\Temp"
fName = Application.GetOpenFileName
End Sub


--
Regards,
Tom Ogilvy




"Corey" wrote in message
...

David,
I had the same thoughts, and actually went through MY Computer rather
than My Network Places, using "Z:\Costing" instead of \\Office2\my
documents\Costing, But i get the same error for some reason.

In the set up of the code(from Ron De Bruin's site) it says it is
suitable for Network applications....

Regards

Corey....

"Dove" wrote in message
...
Corey,

The only time that I mess with documents on a network folder is when I
already have the network share mapped to a drive letter through the OS.
If you map the drive through the OS, check the box to restore the
connection upon reboot it will always have the same drive letter. Then,
you can use the path of "X:\.....\my documents\folder name", eliminate
the ChDrive line and the ChDir will work fine. (Changing the X:\... to
the drive letter and any higher level folders before the "My Documents")

I haven't messed with the ChDrive action before, but it could also be
causing an error since you are giving it a path instead of a drive
letter, and if it isn't already mapped, it could be looking for the
username/password for the network share.

David

"Corey" wrote in message
...
Thanks David for the reply.

I can seem to get the code to work great if i set it to a local
folder,(Did this to test and setup)
But as i need it to look to a folder on a network as:
MyPath = "\\Office2\my documents\folder name"
ChDrive MyPath
ChDir MyPath

I get an error in the ChDrive My Path
and ChDir My Path

Any idea's whay that is ?
And how to rectify it.
Corey....

Regards

Corey McConnell








 
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
VBA Code to Add the same header from my first sheet into 20 sheets [email protected] Excel Worksheet Functions 4 December 15th 06 02:13 AM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Worksheet Functions 6 March 29th 06 12:43 PM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Programming 6 March 29th 06 12:43 PM
run code on opening workbook and apply code to certain sheets Jane Excel Programming 7 August 8th 05 09:15 AM
copy and paste from different sheets into one sheet using a VB code reena Excel Programming 2 August 5th 03 02:49 PM


All times are GMT +1. The time now is 11:15 AM.

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"