Hello All,
Please help me how to activate the wbNew after save the current wbtarget to wbNew:
I'm using the below code but it's not working.
Regards,Please Login or Register to view this content.
tt3
Hello All,
Please help me how to activate the wbNew after save the current wbtarget to wbNew:
I'm using the below code but it's not working.
Regards,Please Login or Register to view this content.
tt3
Last edited by tuongtu3; 06-10-2013 at 02:32 AM. Reason: Solved
The active workbook will be the new workbook. Try the following code. wbTarget was not defined so i changed your code slightly.
Please Login or Register to view this content.
Hi Bill,
I got Run-time error '438' Object doesn't support this property or method at this line
Regards,HTML Code:
tt3
Replace your code with just this...
Note that its the filename that changes and not the open workbook.Please Login or Register to view this content.
The Active workbook is now a workbook with a new filename.
The old file will remain unchanged.
The variable wbTarget is the same open workbook with a new filename
I hope that makes sense.
Also note you were missing a colon in the file path.
Last edited by AlphaFrog; 06-10-2013 at 01:32 AM.
Hi ALpha,
I tried your code and put below code after yours but it does not work.
Regards,Please Login or Register to view this content.
tt3
Updated:
Sorry ALpha, your code works fine and thank you very much for your help.
How to get the new file name on range H2? The below code does not work.
And how to Save and closed this new wb?
Regards,Please Login or Register to view this content.
tt3
Last edited by tuongtu3; 06-10-2013 at 02:07 AM.
Sheets("Sheet1").Range("H2").Value = wbTarget.Name
I don't know if ThisWorkbook and wbTarget are the same workbooks. They may or may not be.
ThisWorkbook is the workbook that contains the macro code regardless of which workbook is active.
Last edited by AlphaFrog; 06-10-2013 at 02:24 AM.
Hi Alpha,
Yes, the code works perfect and thank you very much for your help.
Regards,
tt3
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks