Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8132057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:15:13+00:00 2026-06-06T09:15:13+00:00

I have a macro setup to automatically open/save a file that I am opening

  • 0

I have a macro setup to automatically open/save a file that I am opening from the web. The web format is a #csv.gz format. I have code that currently just saves the file in the default location (which I have changed to c:\files). I want to write a macro that will keep the filename of the file, but change the extention to just file.xlsm. Is there a way to do this with VBA/excel? The reason while I need to change the extension is because it currently does not work with my formulas. The default save code I have just saves the file as a #csv.txt.

Is this possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T09:15:15+00:00Added an answer on June 6, 2026 at 9:15 am

    Integrate this code into your own:

    Sub SaveIt()
    
    Dim wkb As Workbook
    
    Set wkb = ActiveWorkbook 'change to your workbook reference
    
    wkb.SaveAs Replace(wkb.Name, ".txt", ""), 52 'change ".txt" to ".csv" if need be
    
    End Sub
    

    See Excel File Type Enum for more information the 52.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a macro definition in header file like this: // header.h ARRAY_SZ(a) =
I have created a macro for excel which will pop up form that contains
I have found this macro while digging in the source code of tweejump game.
I have an umbraco macro that spits out the content of the page at
I have an object that is derived from QThread and the class definition includes
I have the following code which i copied from here : /*************************************************************************** * _
When I have a View Model setup with an ImportingConstructor that takes a single
I'm trying to save a macro to the file I'm editing. All goes well
I have macro that populates a sheet, and copies values into a grid. I
I have : Macro named "process" that does all the processing work for my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.