+ Reply to Thread
Results 1 to 2 of 2

VBA ActiveWorkbook.SaveAs not working

  1. #1
    Registered User
    Join Date
    07-09-2018
    Location
    Vienna
    MS-Off Ver
    MS Office 2010
    Posts
    4

    VBA ActiveWorkbook.SaveAs not working

    Hi to everyone

    I have some troubles to solve/finish my macro and I need your help! What I want to do is the following:
    • type in the path with the excel file
    • in the excel create a new sheet with some text in it
    • protect the new sheet
    • protect the whole excel file
    • save the file

    The problem occurs at the last step and the file is not saved (the created sheet is protected). Can please someone explain where is the mistake?

    I also noticed that the macro is running through all files in folder even though the files are not excel format. How to fix this as well?

    In attachment you can find my file! Thanks for help!
    Attached Files Attached Files

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: VBA ActiveWorkbook.SaveAs not working

    It's probably saving it in a default location since you're not providing the FileName in the SaveAs call. I played around with your code and removed the necessity for the user form using the application folder picker:

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

+ 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. Sheet.Activate Not Working When Triggered by ActiveWorkbook.SaveAs
    By Rico1919 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-22-2014, 10:05 AM
  2. Activeworkbook.SaveAs
    By SriramDorai in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-12-2014, 05:08 AM
  3. ActiveWorkBook.SaveAs - Not Working
    By kjsconv in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-08-2013, 12:32 PM
  4. ActiveWorkbook.SaveAs
    By Bhawxfan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-28-2010, 12:00 PM
  5. ActiveWorkbook.SaveAs
    By fmardani in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-25-2008, 04:45 AM
  6. [SOLVED] 'ActiveWorkbook.SaveAs Filename'
    By TOMB in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-15-2005, 08:07 PM
  7. ActiveWorkbook SaveAs
    By Mike in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-11-2005, 12:06 AM

Tags for this Thread

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