Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-27-2023, 07:23 AM
BYahr BYahr is offline Using Save As in VBA gives problem with file type. Windows 11 Using Save As in VBA gives problem with file type. Office 2021
Novice
Using Save As in VBA gives problem with file type.
 
Join Date: Mar 2023
Posts: 16
BYahr is on a distinguished road
Default Using Save As in VBA gives problem with file type.

I have the code below to save the current file as an .xlsx file, but when I try to re-open the file, I get a file type error. It appears to be saving the document as an .xlsx file but it truly is staying in the .csv file type which was originally downloaded which Excel cannot access.

What I ultimately want is to have the document changed from .csv to .xlsx file type in a user defined location with the given file name and the date. The date is available in the file and is the day prior to the current date. Example: Trial save mm.dd.yyyy The date needed is located in cell E5 of the document.


Dim path As Variant


path = Application.GetSaveAsFilename( _
Title:="Select a File Location", _
InitialFileName:="Trial save", _
FileFilter:="Excel Files, *.xlsx, Macro Enabled Workbook, *.xlsm")


If path = False Then


MsgBox "No Loction Selected!", 16
Else

ActiveWorkbook.SaveAs path

End If
Reply With Quote
Reply

Tags
excel vba, vba save_as



Similar Threads
Thread Thread Starter Forum Replies Last Post
Save As new file type LBruce Word VBA 12 09-30-2019 06:31 AM
save file problem with win 10 wilg Windows 4 08-24-2016 11:56 AM
Using Save As in VBA gives problem with file type. Word 2007 , when I save a .doc or .docx file the file type is showing "Empty" Tomc29 Word 9 06-10-2015 03:04 AM
Excel 2013, Problem with a shared file, takes long time to load and save and loads missing data PStark Excel 0 12-04-2014 07:52 AM
Set File Type when clicking Save As Madbags Word VBA 1 10-10-2014 01:07 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:37 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft