+ Reply to Thread
Results 1 to 4 of 4

Save as thisworkbook vba

  1. #1
    Forum Contributor
    Join Date
    07-14-2019
    Location
    Dubai
    MS-Off Ver
    2019
    Posts
    919

    Save as thisworkbook vba

    Hello

    I have userform, user will write text in textbox1, then he will click button1

    i want code for button1

    that code for SAVE AS thisworkbook in user desktop, excel file name will be textbox1 value

    note : save as, not normal save

    thats all

    thanks

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Save as thisworkbook vba

    This goes into the UserForm code module.

    Please Login or Register  to view this content.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Forum Contributor
    Join Date
    07-14-2019
    Location
    Dubai
    MS-Off Ver
    2019
    Posts
    919

    Re: Save as thisworkbook vba

    thanks.. i will change xlsx to macro file.. will i need to change file formate number?

    also i think the desktop deriction not coorect
    . after C we have users folder.. then current user folder..then desktop

    thx

  4. #4
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Save as thisworkbook vba

    Quote Originally Posted by e97h View Post
    thanks.. i will change xlsx to macro file.. will i need to change file formate number?

    also i think the desktop deriction not coorect
    . after C we have users folder.. then current user folder..then desktop

    thx
    You need to include these bits of information in your original post so they can be included when the code is developed and save time for all of us. You can if the file is .xlsm currently then just delete the 'FileFormat' part of the statement and make the change to the .xlsx. The FileFormat is not needed if you are saving as the same file format as the original. It is needed if you change the file format. I have no idea how your Desktop is loaded into the directory structure, you can check that out and make that change. Outside of those issues, it should work OK.
    Last edited by JLGWhiz; 08-26-2019 at 09:30 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. .xla ThisWorkbook module generates code on save
    By ignominousicon17 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-22-2018, 06:07 PM
  2. workbook_beforesave fires but doesn't do anything when triggered by thisworkbook.save
    By brokenbiscuits in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2017, 09:29 AM
  3. VB Script to save Thisworkbook with changes
    By Yash20 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-15-2016, 04:03 AM
  4. Excel vba code disappears from Thisworkbook when save as workbook is reopened
    By ray.kanata in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-14-2015, 03:00 PM
  5. Replies: 3
    Last Post: 05-14-2013, 08:53 AM
  6. [SOLVED] Set Wb = ThisWorkbook
    By ATLGator in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-01-2012, 02:10 PM
  7. [SOLVED] RE: Help with ThisWorkbook
    By K Dales in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-27-2005, 05:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1