File handling

K

Killer Janis B

I have a spreadsheet written in Excel 2003 that creates files and adds a
custom file extension e.g. .prc to files and assigns this to a variable to
save a file e.g. Just.prc with activeworkbook.save as filename=variable_name.
I am being prompted with a SAVE AS dialog sheet and Excel tries to save the
file in xlsx format. This did not happen previously. Please help.
 
K

Killer Janis B

This may of course help:

With Application
.SheetsInNewWorkbook = 1
.DefaultFilePath = sNewFilePath
End With
Workbooks.Add
ActiveWorkbook.SaveAs Filename:=sNewFilePath

************************
sNewFilePath is set via other code to "Just.prc"
 
B

Bruce

Killer Janis B,

Try this

Sub SaveAsPRC(Filen, sNewFilePath)
fn = Filen & ".prc"
sNewFilePath = "d:"
ActiveWorkbook.SaveAs filename:=sNewFilePath & fn, CreateBackup:=False

End Sub
ActiveWorkbook.Close False
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top