how to save as an excel sheet
I have two Q.
1. I want to save excel sheet through VB6 and when the following massage come to me (the following file already exist do you want to replace it?? Yes NO Cancel)
This massage I don't want to see it any more I want to save the file every day and save the file over the existing file without asking me do you want to replace the file. The codes I use are:
---------------------------------------------------
Dim a As Excel.Application
Dim b As New Excel.Workbook, b1 As New Excel.Workbook
Dim c As New Excel.Worksheet, c1 As New Excel.Worksheet
Set a = New Excel.Application
s1 = "C:\Documents and Settings\cmmsbatch\Desktop\sec.csv"
Dim i As Long
Dim pos As Long, s As Long
Dim arr As Variant
Set b = a.Workbooks.Open(s1)
' this is the line i want to change it
b.SaveAs ("C:\Documents and Settings\cmmsbatch\Desktop\sec-users.csv")
Set c = b.Sheets(1)
i = 2
While c.Cells(i, 1) <> ""
arr = Split(CStr(c.Cells(i, 1)), ",")
c.Cells(i, 2) = CStr(arr(UBound(arr)))
c.Cells(i, 3) = CStr(arr(UBound(arr) - 1))
i = i + 1
Wend
c.[1:1].Delete Shift:=xlUp
SendKeys "{ENTER}"
b.Save
b.Close
End Sub
---------------------------------------------------
2. The second question I want to delete specific excel sheet file then save other file into specific place.
Best Regard,
|