+ Reply to Thread
Results 1 to 13 of 13

auto saving activeworkbook with specific name

  1. #1
    Registered User
    Join Date
    02-07-2012
    Location
    Jakarta
    MS-Off Ver
    Excel 2003
    Posts
    8

    Talking auto saving activeworkbook with specific name

    Hello Experts..

    I need your help to point me to the right direction.
    I have an Excel macro that extract data directly from SAP system , and when the data export it to Excel it's has workbook name as ALVXXL01(1).
    Usually I use ActiveWorkbook.SaveCopyAs code to grab it and save it to desired folder and file name but sometimes it's won't work . it's saved the master file instead of the activeworkbook of ALVXXL01(1).

    Now , I am trying to use below new code but it's still not works yet.

    Please Login or Register  to view this content.

    Any help would be really appreciated! Thanks.

    Regards,
    Agung
    Last edited by Rohmadi02; 02-16-2012 at 03:02 AM. Reason: Added Code Tags

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: auto saving activeworkbook with specific name

    In the above code, you have not assigned "sWbk" to anything. See if it works, if not let me know.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    02-07-2012
    Location
    Jakarta
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: auto saving activeworkbook with specific name

    Hi Arlette, Thanks for the advise if I set "sWbk" as active workbook, this is not works. Pls complete the code as actually I am not expert on this , the code was obtained from forum.

    Hi TMShucks,thanks for the info , I am newbi to this forum , tried to use code between them as below.


    Please Login or Register  to view this content.

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: auto saving activeworkbook with specific name

    You need to put code tags around your code. Only then, i will be able to assist you. Check the forum rules on how you can put the code tags.

  5. #5
    Registered User
    Join Date
    02-07-2012
    Location
    Jakarta
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: auto saving activeworkbook with specific name

    Hello Arlette..
    I have put the code tag around my code..
    see below

    Please Login or Register  to view this content.
    Pls assist on the correct script for Excel VBA.
    Thanks.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,086

    Re: auto saving activeworkbook with specific name

    @Rohmadi02: for future reference, you should edit the original post and add the code tags there. I will do it for you this time.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  7. #7
    Registered User
    Join Date
    02-07-2012
    Location
    Jakarta
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: auto saving activeworkbook with specific name

    @TMShucks , Thanks for that, I appreciate it.

  8. #8
    Registered User
    Join Date
    02-07-2012
    Location
    Jakarta
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: auto saving activeworkbook with specific name

    @Arlette, Can you pls assist me to correct my above code?

    Thanks & regards,
    Agung

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: auto saving activeworkbook with specific name

    Use this code -
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    02-07-2012
    Location
    Jakarta
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: auto saving activeworkbook with specific name

    Hi Arlette,
    Thank you but it's got run time error '438': object does not support this property or method.
    after press debug button, this line "If InStr(Wk, "ALVX") <> 0 Then" has yellow coloured.

    any other alternatives suggestion??

    Thank you .

  11. #11
    Registered User
    Join Date
    02-07-2012
    Location
    Jakarta
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: auto saving activeworkbook with specific name

    Hi Arlette,
    Thank you but it's got run time error '438': object does not support this property or method.
    after press debug button, this line "If InStr(Wk, "ALVX") <> 0 Then" has yellow coloured.

    any other alternatives suggestion??

    Thank you .

  12. #12
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: auto saving activeworkbook with specific name

    Oops i am sorry, it had to be If InStr(Wk.name, "ALVX")

  13. #13
    Registered User
    Join Date
    02-07-2012
    Location
    Jakarta
    MS-Off Ver
    Excel 2003
    Posts
    8

    Thumbs up Re: auto saving activeworkbook with specific name

    Hi Arlette,
    Thank you so much ..It's works now..

    Regards,
    Agung

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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