+ Reply to Thread
Results 1 to 8 of 8

macro open new workbook

  1. #1
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    macro open new workbook

    Hi I have below code which can open a text file or a csv file and change the coding. It works good, but i need it to instead of
    open a new workbook to open it in a sheet in the active workbook example sheet3 or a named sheet.
    Please have a look.
    Thanks in advance

    Sincerely
    Abjac
    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: macro open new workbook

    This code
    - opens File002.xlsx
    - in folder C:\TestArea
    - sheet named "Output" is made the active sheet

    Is it what you want?
    Please Login or Register  to view this content.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  3. #3
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: macro open new workbook

    Please give this a try...

    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  4. #4
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: macro open new workbook

    HI Kev and thanks . No infact i open a csv file and it open now a new workbook and name it after the file i open. I want the macro to open the textfile and safe the output in the workbook, where i run the macro in a specified sheet example sheet3. So not to safe in external file or sheet but in same workbook in a named sheet from start A2.

    Sincerely
    Abjac

  5. #5
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: macro open new workbook

    Hi Skeetner. It are working fine but the only thing is it dont make the most important encoding as 65000 as you can see in my macro
    Sincerely
    Abjac

  6. #6
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: macro open new workbook

    In that case you may try it like below...

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: macro open new workbook

    Hi. Skttneer. That makes the difference. It works like a charm and open the file with the special characters perfect. Thanks alot.
    Sincerely
    Abjac

  8. #8
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: macro open new workbook

    You're welcome Abjac!
    Thanks for the feedback.

+ 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] Macro to open workbook with a suffix (need help to check if file is already open)
    By rossi_69 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-24-2017, 11:03 AM
  2. Macro VBA to copy and paste cells from one open workbook to another open workbook
    By bloomingcarrot in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-23-2014, 07:55 PM
  3. macro to copy cells(Range) from an open Workbook to another open Workbook.
    By jbester in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-22-2013, 09:47 AM
  4. Macro to open a closed workbook and select copy cells into an open workbook
    By helloganesh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-10-2013, 02:00 PM
  5. [SOLVED] Macro to copy data from open workbook to next open line of new workbook
    By nhtodd in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-11-2012, 09:42 PM
  6. Macro to copy data from other workbook - let user choose which open workbook
    By ssu95bm in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-12-2011, 11:17 AM
  7. Open workbook macro- find correct month to open?
    By buzzharley in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-07-2006, 11:30 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