Moving macro from Excell 2003 to Excell 2010

JanoT

New Member
Joined
Jun 23, 2011
Messages
8
Hi,
my macro Excell 2003 starts:
.
.
Dim fso As New FileSystemObject
Set co = CreateObject("Scripting.FileSystemObject")
Set wf = Application.WorksheetFunction
Set fs = Application.FileSearch
.
.

I have tried run in Excell 2010 and there appeard error message:

Compile error:
Can´t find project or library.

Could somebody advice me?
 
Actually, FileSearch object exists in Excel 2007/2010 object model (you can see this by selecting "Show Hidden Members" when righ-click in Object Browser). However, it doesn't work.
What do you try to achieve?
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Actually, FileSearch object exists in Excel 2007/2010 object model (you can see this by selecting "Show Hidden Members" when righ-click in Object Browser). However, it doesn't work.
What do you try to achieve?



I use DIM .... from reason that I use next code in one part of my macro:


uzbolo:
If fso.FolderExists(Sub_down & "\" & TRSNumber) Then
GoTo uzbolo1
Else
fso.CreateFolder Sub_down & "\" & TRSNumber
End If
uzbolo1:
Worksheets("Temp").Activate

JanoT
 
Upvote 0
uzbolo:
If fso.FolderExists(Sub_down & "\" & TRSNumber) Then
GoTo uzbolo1
Else
fso.CreateFolder Sub_down & "\" & TRSNumber
End If
uzbolo1:
Worksheets("Temp").Activate

What for uzbolo1? Isn't it easier following?
Code:
uzbolo:
    If fso.FolderExists(Sub_down & "\" & TRSNumber) Then
        Worksheets("Temp").Activate
    Else
        fso.CreateFolder Sub_down & "\" & TRSNumber
    End If

The thing is in your code sheet "Temp" will be activated EVERY TIME.
 
Upvote 0
What for uzbolo1? Isn't it easier following?
Code:
uzbolo:
    If fso.FolderExists(Sub_down & "\" & TRSNumber) Then
        Worksheets("Temp").Activate
    Else
        fso.CreateFolder Sub_down & "\" & TRSNumber
    End If

The thing is in your code sheet "Temp" will be activated EVERY TIME.


It was an example, after Uzbolo1 there are anothe codes not only Worksheet(!Tem!).Activate

I have send you my workbook by mail. Could you analyze in in Excell 2010.

Thanks.
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,844
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top