Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Doh...
You can specify a file format on this line: ActiveWorkbook.SaveAs Filename:=strFileName Either look at VBA's help or record a macro when you save a test workbook as ..wk4. Aaron wrote: Hi, A gentleman helped me yesterday and showed me how to do a save as with this code: '=================================== Sub SaveWithDate() ' Dim wb As Workbook Dim ws As Worksheet Dim varVal As Variant Dim strFileName As String Set wb = ActiveWorkbook Set ws = wb.Worksheets("$ Reference") varVal = ws.Range("C2").Value If IsDate(varVal) Then strFileName = "Glue Sched_" & Format(CStr(varVal), "mm-dd-yyyy") & ".xls" Else strFileName = "Glue Sched_" & Format(CStr(Date), "mm-dd-yyyy") & ".xls" End If ChDir "\\Lan1\Supervisor\Departments\Foam\SCHEDULING \Old Schedules" ActiveWorkbook.SaveAs Filename:=strFileName Set wb = Nothing Set ws = Nothing End Sub '====================== I now need to be able to save this file as a wk4 because this person needs it that way. I thought I could just change the extension to wk4 above. I did that and it saved it that way, but he was unable to open the file. I have found that I need to choose the file type of wk4 rather than give it that extension. Can someone help with code to change the file type to wk4 as you would do in the drop down of the save as?? -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Save, save as, page setup dimmed out in unprotected excel sheet? | Excel Discussion (Misc queries) | |||
Totally Disabling (^ save ) (Save as) and Save Icon – Which code do I use: | Excel Programming | |||
when i save xls file, debug script is running and canno't save fil | Excel Discussion (Misc queries) | |||
Save Excel file - prompts to save - no Volitile functions used | Excel Worksheet Functions | |||
Why system asks me to save change even after I call save method(VB.NET) | Excel Programming |