+ Reply to Thread
Results 1 to 6 of 6

transfer data to another worksheet, save new worksheet to another folder, all closed

  1. #1
    Registered User
    Join Date
    09-08-2014
    Location
    US
    MS-Off Ver
    2010
    Posts
    38

    transfer data to another worksheet, save new worksheet to another folder, all closed

    Hello everybody,

    I am having a hard time with this one and any help would be greatly appreciated as I have spent alot of hours trying to get the code down correctly. I am trying to transfer data from a userform to another worksheet in a shared folder. After the data is transferred, I would like it to automatically save to another folder destination, all while the new workbook is on a closed basis and never having the new work book pull up. If the user wants to pull up the data again to review it, they would use the new destination folder to bring up the new file that was created. Also, I would not like to save the document where the new workbook originally generated from because it would be a blank form, so the user would just have to open up the file where it was saved to. I attached my code below. Right now it is set to open the workbook, but I would like to change that and not have the user have to ever see it. Also, in my AutosaveAIRcalc macro to save the file to another destination, I have having trouble with the FileFormat:=xlNormal wording because it gets highlighted. I have a cell in the new workbook from cell Q8 that will be the file name when it gets saved to the new folder. Thanks in advance for the help.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: transfer data to another worksheet, save new worksheet to another folder, all closed

    You can't work on a workbook that isn't open, but you could hide any activity by putting "Application.ScreenUpdating = False" before your Open. Then after your SaveAs, put ActiveWorkbook.Close, and they won't see a thing unless it blows up. Maybe add a Msgbox saying "Process complete" so they know something happened. Try leaving off the FileFormat piece. I would expect it to save it with its existing file format.
    Acts 4:12
    Salvation is found in no one else, for there is no other name under heaven given to mankind by which we must be saved.

  3. #3
    Registered User
    Join Date
    09-08-2014
    Location
    US
    MS-Off Ver
    2010
    Posts
    38

    Re: transfer data to another worksheet, save new worksheet to another folder, all closed

    Thank you for the reply. I made the changes below and unfortunately got an errror. The first one states the followng feature cannot be saved in a macro-free workbook
    *VB Project

    To save a file with these features, click no, then choose a macro enabled file type in the File Type list
    To continue saving as a macro free workbook, click yes

    If i click no, it says VB projects and XLM Sheets cannot be saved in a macro free workbook
    If I click yes, it errors out and highlights the password in my macro listed at the botton, Sub AutosaveAIRcalc()

    I would like to save as macro enabled workbook, which is why I changed the format to .xlsm and not have to have any popup boxes come up, since everything will be behind the seensAny ideas? thanks again.

    Please Login or Register  to view this content.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    09-08-2014
    Location
    US
    MS-Off Ver
    2010
    Posts
    38

    Re: transfer data to another worksheet, save new worksheet to another folder, all closed

    OK, I think I got it figured out. All I did was change the .xlt file extension to .xlsm. that seemed to solve the problem. Everything now works great! Thank alot for the help.

  5. #5
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: transfer data to another worksheet, save new worksheet to another folder, all closed

    I guess I hadn't looked at your code very carefully before, but I'm confused. The Activeworkbook is the one with the code and the userform. Nwb is the one you're trying to open, update, and save, right? But your Autosave subroutine is saving the activeworkbook, not nwb. That's why it was squawking about macros (it was trying to save Activeworkbook as an xlt. I'm assuming nwb doesn't contain macros, so that shouldn't have been a problem. You need to be doing the SaveAs on nwb, not on ActiveWorkbook.

  6. #6
    Registered User
    Join Date
    09-08-2014
    Location
    US
    MS-Off Ver
    2010
    Posts
    38

    Re: transfer data to another worksheet, save new worksheet to another folder, all closed

    This is the code I used and it transfers the data, auto saves with the cell reference, then closes right way.

    Please Login or Register  to view this content.

+ 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. [SOLVED] Transfer Userform data on 1 worksheet to different worksheet (empty row = wrong sheet)
    By HeyInKy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-26-2014, 10:08 AM
  2. [SOLVED] Macro to list worksheet names of all closed workbooks in a specified folder
    By Chrispelletier in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 05-15-2014, 12:52 PM
  3. Need Help Creating A Macros To Transfer Data From Worksheet to Worksheet
    By rodtay5283 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-27-2014, 02:11 AM
  4. [SOLVED] Copy Data from One Worksheet to another closed worksheet
    By BHI_ET in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-13-2012, 02:22 PM
  5. How to save a single worksheet as worksheet name in new folder??
    By Simon Lloyd in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-16-2006, 10:20 AM

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