PDA

View Full Version : Not Saving



Puddles1
09-25-2014, 09:47 AM
Hello!

This is not saving as an Excel file or saving to the path specified (or anywhere that I can tell). And I am not getting any erros and it seems to be working but when I go to look for the file it isn't there.

ChDir "G:\xxxx\Maintenance\Logging"
Dim FName As String
FName = Application.GetSaveAsFilename("G:\xxxx\Maintenance\Logging""ExcelFile,(*.xlsx),*,.xlsx")
FileFormat = xlOpenXMLWorkbook

mancubus
09-25-2014, 11:15 AM
welcome to the forum.
use code tags when posting your code here. clickng the # button will do it for you.

try like


Dim FName As String


FName = Application.GetSaveAsFilename("MyBook", "Excel Files (*.xlsx), *.xlsx")


Workbooks.Add
ActiveWorkbook.SaveAs Filename:=FName, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close SaveChanges:=False




this procedure will add a blank workbook, save as with the name specified, and close it.

Puddles1
09-25-2014, 01:11 PM
Awesome, that works. Thanks so much :hi:

mancubus
09-25-2014, 02:02 PM
you are welcome.

pls mark the thread as solved from thread tools dropdown.