#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Why ?

I have written a small app to check for files within folders on other pcs
( to keep them updated with latest version of work files ) but for some
reason it wont work on the ho PC is it because it has an older version of
excel or is there another reason im missing

any help would be appreciated



regards

pete

BELOW IN THE MIDDLE LINE IS WHERE THE ERROR OCURS

Set fs = CreateObject("Scripting.FileSystemObject")

Set f = fs.GetFolder(Range("d1").Value)

Set sf = f.SubFolders

A MORE DETAILED LOOK ATHE MACRO

Application.ScreenUpdating = False
Sheets("DELETEDFILES").Select '''
Columns("G:G").Select
Selection.ClearContents
Selection.Interior.ColorIndex = xlNone
Range("d1").Value = Range("A1").Value
Do Until Range("d1").Value = ""
Range("F1").Select
Dim fs, f, f1, s, sf
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(Range("d1").Value)
Set sf = f.SubFolders
For Each f1 In sf
s = s & f1.Name
s = s & vbCrLf
ActiveCell.Value = Range("d1").Value & "\" & f1.Name
ActiveCell.Offset(1, 0).Select
Next

D1 VALUE = ACTIVE WORKBOOK PATH
--
(][ This Email has been scanned by Norton AntiVirus. ][)


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Why ?

If the middle line is:

Set f = fs.GetFolder(Range("d1").Value)

I'd add this to find out what's in D1:

Msgbox range("d1").value
Set f = fs.GetFolder(Range("d1").Value)

Maybe it's not what you think--wrong sheet is active???



OZDOC1050 wrote:

I have written a small app to check for files within folders on other pcs
( to keep them updated with latest version of work files ) but for some
reason it wont work on the ho PC is it because it has an older version of
excel or is there another reason im missing

any help would be appreciated

regards

pete

BELOW IN THE MIDDLE LINE IS WHERE THE ERROR OCURS

Set fs = CreateObject("Scripting.FileSystemObject")

Set f = fs.GetFolder(Range("d1").Value)

Set sf = f.SubFolders

A MORE DETAILED LOOK ATHE MACRO

Application.ScreenUpdating = False
Sheets("DELETEDFILES").Select '''
Columns("G:G").Select
Selection.ClearContents
Selection.Interior.ColorIndex = xlNone
Range("d1").Value = Range("A1").Value
Do Until Range("d1").Value = ""
Range("F1").Select
Dim fs, f, f1, s, sf
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(Range("d1").Value)
Set sf = f.SubFolders
For Each f1 In sf
s = s & f1.Name
s = s & vbCrLf
ActiveCell.Value = Range("d1").Value & "\" & f1.Name
ActiveCell.Offset(1, 0).Select
Next

D1 VALUE = ACTIVE WORKBOOK PATH
--
(][ This Email has been scanned by Norton AntiVirus. ][)


--

Dave Peterson

Reply
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



All times are GMT +1. The time now is 12:35 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"