Re: Need some help...



Stephany,

After posting last night, I ran back through my code and there was a LOT of
stuff that I discovered about my code being incomplete and illogical.*sigh*
I was pointing one directory too high AND was not using the correct source
to draw from. Took a bit for me to work it out, but found that I was using
the destination folder as my source folder and was getting some really weird
results. Tom's post last night and yours this morning really helped me get
things ironed out in my mind. Incorporating the parts that you posted this
morning, here is my new compression sub, hopefully all neat and tidy. I know
that this one works as it should. LOL I've also decided to use labels with
autoellilpsis turned on in place of the text boxes. I did this as a personal
attribute because of space issues and my own anal perspective toward
neatness. I am doing the sanity check on the label entries from a seperate
sub so that is taken care of. If the user doesn't select a From and To
folder, it won't go anwhere but back to the folderbrowserdialog. Thanks
again for all the help.

The (hopefully) almost completed compression sub...

Private Sub CompressFolder(ByVal strSourceDir As String, ByVal strTargetDir
As String)

Dim _Folders As String() = Directory.GetDirectories(strSourceDir)

prbProgress.Maximum = _Folders.Length

prbProgress.Step = 1

prbProgress.Visible = True

lblProgress.Visible = True

For Each _Folder As String In _Folders

Dim strFinalFile As String = Path.ChangeExtension(Path.Combine(strTargetDir,
_

Path.GetFileName(_Folder)), "cab")

lblProgress.Text = ("Compressing: " & Path.GetFileName(_Folder))

lblProgress.Update()

Dim i_Compress As New CabLib.Compress

i_Compress.CompressFolder(_Folder, strFinalFile, "", 0)

prbProgress.PerformStep()

prbProgress.Update()

Next

prbProgress.Visible = False

lblProgress.Visible = False

End Sub




.



Relevant Pages

  • Re: Change Code in Macro to specify file/folder to look in.
    ... SFile As String ... Sub TestFolderOpen() ... Dim Test As FileProperties ... that folder and file for the information instead of prompting me. ...
    (microsoft.public.excel.programming)
  • Re: Date Modified File Organization
    ... "MakeSureDirectoryPathExists" (ByVal lpPath As String) As Long ... Private Fnum As Long ... Dim myStartingFolder As String ... MsgBox "Invalid starting folder!" ...
    (microsoft.public.excel.misc)
  • Re: changing links in multiple ppt files using search and replace
    ... are the needed files in the folder you're resetting the link to ... Dim rayFileList() As String ... this will only work in PPT 2000 and later ...
    (microsoft.public.powerpoint)
  • RE: If Statement help
    ... Dim newbk As Variant ... Right now the macro takes all the files in the current folder, ... 'This is very useful in quickly archiving and storing daily batch files ... Dim objFile As File, strSourceFolder As String, strDestFolder As String ...
    (microsoft.public.excel.programming)
  • RE: If Statement help
    ... "Denise Pollock" wrote: ... Dim newbk As Variant ... Right now the macro takes all the files in the current folder, ... Dim objFile As File, strSourceFolder As String, strDestFolder As String ...
    (microsoft.public.excel.programming)