Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Invalid Procedure Call
I have the following code I am trying to execute:
At w = Dir() near the end of the procedure, I get the "Invalid Procedure Call or Argument" error message. I thought I knew what to do about this but nothing works. Any ideas welcomed. Sub CopyAll() Dim VBComp As VBIDE.VBComponent Dim FName As String Dim w As String w = Dir("C:\Users\Jim\Documents\MsExcel\*.xls") Do While w < "" Workbooks.Open (w) With Workbooks(w) FName = .Path & "\code.txt" If Dir(FName) < "" Then Kill FName End If For Each VBComp In .VBProject.VBComponents If VBComp.Type < vbext_ct_Document Then VBComp.Export FName ThisWorkbook.VBProject.VBComponents.Import FName Kill FName End If Next VBComp End With Workbooks(w).Close w = Dir() ' Error Message "Invalid Procedure Call or Argument" Loop End Sub -- Thanks, Pops Jackson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
CreatePivotTable: Invalid procedure call or argument | Excel Programming | |||
Invalid procedure call trying to use FormatConditions | Excel Programming | |||
invalid procedure call | Excel Programming | |||
problem with excel invalid procedure call | Excel Programming | |||
Invalid Procedure call or argument | Excel Programming |