Results 1 to 8 of 8
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    sava wbook with cell name (2000 sr 1)

    assuming i have this wbbok is possible with a macro to save on c:mydirmysubdirAGENZIA_&part of cell in D1? (overwrite the existis wbook with the same name witouth confirm)

    Similar:

    AGENZIA_4516.XLS

    Note: if is possible to save the wbook without the button LOGON and IMPORTA? That becuase on this 2 button are assigned operating macro only for Admin and not fro user can open this wbook.....;-)

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: sava wbook with cell name (2000 sr 1)

    Try this:

    Sub SaveIt()
    Dim strFile As String
    Dim strCaption
    Dim i As Long
    For i = Worksheets("MENU").Shapes.Count To 1 Step -1
    If Worksheets("MENU").Shapes(i).Type = msoAutoShape Then
    Select Case Worksheets("MENU").Shapes(i).DrawingObject.Caption
    Case "LOGON ", "IMPORTA"
    Worksheets("MENU").Shapes(i).Delete
    End Select
    End If
    Next i
    strFile = Worksheets("MENU").Range("D1")
    strFile = "c:mydirmysubdirAGENZIA" & Mid(strFile, InStr(strFile, "_")) & ".xls"
    ActiveWorkbook.SaveAs strFile
    End Sub

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: sava wbook with cell name (2000 sr 1)

    Hans, great code...
    But after this opeartion all wbook are closed, i would want to maintain active the master wbook MENU (for a new elaboration) and save a copy with strFile ecc....peraph i have posted i wrong mode my question:-(

    In effect i run avrious macro from MENU Wbook, save the new wbbok, and re-show the Master Wbook for new elaboration....

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: sava wbook with cell name (2000 sr 1)

    Try replacing

    ActiveWorkbook.SaveAs ...

    with

    ActiveWorkbook.SaveCopyAs ...

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: sava wbook with cell name (2000 sr 1)

    perfect...
    But into original wbook after the copy of replica wbook, the 2 button mentioned are deleted?!

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: sava wbook with cell name (2000 sr 1)

    Just close it without saving it then...

  7. #7
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: sava wbook with cell name (2000 sr 1)

    ok yes but with the famous 2 button (reserved for Admin) i must run for 52 to import a txt file andd work with this, not is pratic to open and cclose for 52 elaboration?!?!... or not?

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: sava wbook with cell name (2000 sr 1)

    Once you have run LOGON and IMPORTA, you can run various exports without closing the workbook.
    If that doesn't help, you should rethink the way you are using this workbook.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •