Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default Can't compile, module empty?

I've copied a macro from here and modified it for my situation. I want
to open each file in the "Base" directory, run "SPSSClean" on it, the
save it to the "Mod" directory.

Sub MoveandClean()
Dim strDirBase, strDirMod, strFName As String

strDirBase = "H:\My Documents\Jenise M\PIP Drilldown\SFY 05 Q2\Base"
strDirMod = "H:\My Documents\Jenise M\PIP Drilldown\SFY 05 Q2\Mod"
strFName = Dir(strDirBase)

Do Until strFName = ""

Workbooks.Open strDirBase & strFName ', True, False

Call SPSSClean

ActiveWorkbook.SaveAs Filename:=strDirMod & "\" & strFName &
"mod"
ActiveWorkbook.Close
strFName = Dir()
Loop

End Sub

The macro does nothing. It gets to "do until strFName = "", then skips
to end sub. Doesn't see the files at all. A watch on strFName says
"Can't compile, Module empty". What does module empty mean? Obviously,
there's something in the module.
Any suggestions?
Thanks all.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default Can't compile, module empty?

The correct error message is "cant compile module". The empty is the
next field in the Watch window

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Can't compile, module empty?

from this immediate window:

? dir("C:\data5")
< this returns nothing
? dir("C:\data5\")
5B_73_TOFL.xls

so try puting a "\" on the end of strDirBase

better, try putting a "\*.xls" on the end
--
Regards,
Tom Ogilvy

"davegb" wrote in message
oups.com...
I've copied a macro from here and modified it for my situation. I want
to open each file in the "Base" directory, run "SPSSClean" on it, the
save it to the "Mod" directory.

Sub MoveandClean()
Dim strDirBase, strDirMod, strFName As String

strDirBase = "H:\My Documents\Jenise M\PIP Drilldown\SFY 05 Q2\Base"
strDirMod = "H:\My Documents\Jenise M\PIP Drilldown\SFY 05 Q2\Mod"
strFName = Dir(strDirBase)

Do Until strFName = ""

Workbooks.Open strDirBase & strFName ', True, False

Call SPSSClean

ActiveWorkbook.SaveAs Filename:=strDirMod & "\" & strFName &
"mod"
ActiveWorkbook.Close
strFName = Dir()
Loop

End Sub

The macro does nothing. It gets to "do until strFName = "", then skips
to end sub. Doesn't see the files at all. A watch on strFName says
"Can't compile, Module empty". What does module empty mean? Obviously,
there's something in the module.
Any suggestions?
Thanks all.



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


Similar Threads
Thread Thread Starter Forum Replies Last Post
compile error in hidden module mikesteven Excel Discussion (Misc queries) 2 October 30th 08 01:00 AM
Compile error in hidden module [email protected] Excel Discussion (Misc queries) 3 February 12th 08 03:01 PM
Compile error in hidden module arjay Excel Discussion (Misc queries) 5 September 16th 05 12:47 AM
compile error in hidden module..... Patrick Excel Programming 0 May 11th 05 09:11 PM
Compile Error in Hidden Module: Patrick[_7_] Excel Programming 1 January 6th 04 12:59 PM


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