Why Excel process is still there on Task Manager list

C

clara

Hi all,

My project is about pick up info from individual workbook, and merge the
info into a new workbook. But in the end of code, even I set nothing to
workbook and application object, but the Excel process is still there, but
the way the open and close procedure is very slow, is there any way to
expedite it?

Dim SrcWrk As Workbook
Dim DstWrk As Workbook
Dim app As New Application


DstWrk = app.Workbooks.Add()

For Each File As String In Directory.GetFiles(Me.SrcDir, "*.xls",
System.IO.SearchOption.AllDirectories)


SrcWrk = app.Workbooks.Open(File)

SrcWrk.Close()
SrcWrk = Nothing

Next

DstWrk.SaveAs(Me.DesDir & "\" & Me.DesFileName)
DstWrk.Close()
DstWrk = Nothing
app.Quit()
app = Nothing

--

You can see, now there is no action within the loop.

Clara
thank you so much for your help
 
J

joel

There is too reasons why the macro is taking a long time

1) If the worksbooks are large it will take time to open and close the
workbooks

2) You are searching all the subdirectories (Me.SrcDir and subfolders
which can take a very long time.

The one question I have is how long does it take to open any of thes
workbooks by themseleves. Then multiply this number by the number o
workbooks you are opening.

You may havve a problem on your PC with opening any workbook. tr
opening one of these workbooks on another PC and see if it also takes
long time. You may havve a problem on your PC that needs to be fixed.

Also if you are trying to open the workbooks froom a Network drive thi
could also slow down the macro.

You may also have INDEXING enabled on your PC or Newwork drive that i
slowing down the process and turing off Indexing may help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top