Thread: VBA Problems
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_4_] Don Guillett[_4_] is offline
external usenet poster
 
Posts: 2,337
Default VBA Problems

Let's see you sub. Hope you are not saving to the floppy. You should save to
HD and COPY to the floppy.
Have a look at vba HELP indes for KILL to kill the files first
HTH

Sub CopyToFloppy()
Application.DisplayAlerts = False
IsFloppyReady ' Macro below
Dim fso As Object
myfile = ActiveWorkbook.Name
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile "c:\yourfolder\" & myfile, "a:\"
Application.DisplayAlerts = True
End Sub

Sub IsFloppyReady()
Dim drv As String
Dim s As String
Dim fso
s = "Drive A has no Floppy..." & vbLf & _
"Please insert a floppy in the 'A' Drive"
Set fso = CreateObject("Scripting.FileSystemObject")
With fso
drv = .GetDriveName("A:\")
'// Is Drive Ready? (No Floppy in A:)?
If Not .getdrive(drv).IsReady Then
MsgBox s
End If
End With
End Sub



--
Don Guillett
SalesAid Software

"Stromma " wrote in message
...
Hi All!

I have a backup sub that saves workbook data to a floppy disc. How can
i delete all data (emtpy the whole disc) that's already on the floppy
before saving the new one?

In one worksheet data is saved from columns ("A:E") and the date when
it was saved is i column ("F"). Every monday i printout all data that
was saved the week before. I want create a printout userform with to
ComboBoxes that allows me to print from the date i select, ex:
Print from "2004-02-16" (ComboBox1) to "2004-02-20" (ComboBox2).
I know how to create the UserForm and how to set the ListFillRange for
the ComboBoxes, but how can i use the selection of the ComboBoxes to
set the printout range?

Cheers

/Stromma


---
Message posted from
http://www.ExcelForum.com/