Results 1 to 13 of 13

auto saving activeworkbook with specific name

Threaded View

  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.

    Sub SavecopyAsWorkbook()
    Dim Wk As Workbook
    Set Wk = ActiveWorkbook
    Dim sWbk As String
    
    Application.DisplayAlerts = False
    
    If InStr(sWbk, "ALVX") <> 0 Then
    
    Wk.SaveCopyAs Filename:="C:\Temp\testwbksave.xls"
    End If
    
    Application.ScreenUpdating = True
    
    End Sub

    Any help would be really appreciated! Thanks.

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

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