Advertisement

03.30.2005 at 06:54PM PST, ID: 21370814
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.4

Use of Macro seems to hang up File-Open or File-Save (filesystemobject is in macro)

Asked by rsknow in Microsoft Office Suite

Tags: , , , ,

When I do a file-open or file-save my system hangs up for several seconds - it comes to a stop at the drop-down arrow & I have to click on it again and still wait.  It seems this problem only happens after I use an Excel macro that an Expert helped me create using filesystemobject.   Some of that macro is posted below.  It appears to me to be releasing the filesystemobject - but I'm no expert & could easily be wrong.  After the macro is completed could there be anything left in memory that causes Excel to do this hesitation?  When the hesitation happens with Excel & I try to use Word the same hesitation occurs.  Windows Explorer works OK all of the time.  No one else at work has complained about this problem so I figue it's something I am doing/using that they aren't.


 Dim f
    Dim fl
    Dim ofl
    Dim Path As String
    Dim fso
 
    Set fso = CreateObject("scripting.filesystemobject")
    Path = "C:\My Documents\Files\"
   
   For Each f In fso.GetFolder(Path).Files
   fName = f.Name
 
'This macro only looks at the Detailed General Ledger text files.
  If UCase(fName) Like "FMTLPFK*.TXT" Then
    'make a copy of the original file in "Original" subdirectory & make a work copy to filter
    fso.CopyFile Path & fName, Path & "Original\" & fName
    f.Name = fName & "v2"
   
   vCT = 0
   Set ofl = f.OpenAsTextStream
   Set fl = fso.CreateTextFile(Path & fName)
   Do Until ofl.AtEndOfStream
    TempStr = ofl.ReadLine
    vCT = vCT + 1
    If vCT < 10 Then
     fl.WriteLine TempStr
    Else

  LOOP THROUGH & DO A BUNCH OF STUFF HERE

    'Save & close the workbook
    ActiveWorkbook.Save
    ActiveWindow.Close
   
    fso.DeleteFile Path & fName
   
   'OPEN THE NEXT FILE IN THE DIRECTORY UNTIL ALL ARE PROCESSED
   End If
  End If
 Next
     MsgBox "The Processed EXCEL files were saved in " & Path & _
      "Processed\" & " and Original TEXT files were moved to " & Path & "Original\"

 Set f = Nothing
 Set fl = Nothing
 Set fso = Nothing
End Sub
Start Free Trial
[+][-]03.30.2005 at 10:14PM PST, ID: 13669047

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]03.31.2005 at 08:07AM PST, ID: 13672723

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Office Suite
Tags: excel, file, hangs, macro, open
Sign Up Now!
Solution Provided By: mvidas
Participating Experts: 2
Solution Grade: A
 
 
[+][-]04.01.2005 at 10:32AM PST, ID: 13683110

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.01.2005 at 11:46AM PST, ID: 13683778

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32