+ Reply to Thread
Results 1 to 2 of 2

problem saving a file thru a macro it works on windows 7 but not on xp

  1. #1
    Registered User
    Join Date
    05-04-2013
    Location
    Florida, United States
    MS-Off Ver
    Excel 2010
    Posts
    16

    problem saving a file thru a macro it works on windows 7 but not on xp

    Sub JustRepairOrder()
    '
    ' JustRepairOrder Macro
    ' Copy and saves the repair order to its file name then erases everything so you can start the next one
    '
    ' saves Just vehicle repair order with the file name taken from cell r54


    ' saves repair order with the file name taken from cell r54 in roreq folder
    Sheets("Just vehicle repair order").Select
    ActiveSheet.Unprotect
    Sheets("Just vehicle repair order").Copy
    thisfile = Range("r54").Value
    strFolder$ = "D:\new sws folder\maintenance\roreq\" & Split(thisfile, "-")(1)
    If Len(Dir$(strFolder$, vbDirectory)) = 0 Then MkDir strFolder$

    ' this is ware the debugger takes me
    ActiveWorkbook.SaveAs Filename:=strFolder$ & "\" & thisfile


    ' breaks links
    ActiveWorkbook.BreakLink Name:= _
    "D:\new sws folder\Maintenance\Orl1 Mechanics Work.xlsm", Type:=xlExcelLinks
    ' saves the changes
    ActiveWorkbook.Save
    ActiveWorkbook.Close
    ' Clears the contents from Just vehicle repair order to start over
    ActiveSheet.Unprotect
    ' Clears the old just vehicle repair order
    With Sheets("just vehicle repair order")
    Range("AR2:AV5").ClearContents
    Range("AB4:AK5").ClearContents
    Range("I8:AV17").ClearContents
    Range("C8:G8").ClearContents
    Range("C13:G13").ClearContents
    Range("C36:G36").ClearContents
    Range("C43:G44").ClearContents
    Range("C46:G47").ClearContents
    Range("C49:G50").ClearContents
    Range("C52:G53").ClearContents
    Range("I21:AT46").ClearContents
    Range("I49:Q50").ClearContents
    Range("R49:AE50").ClearContents
    Range("AB51:AL53").ClearContents
    End With
    ActiveSheet.Protect
    Range("AB4:AK5").Select
    ActiveWorkbook.Save

    End Sub

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: problem saving a file thru a macro it works on windows 7 but not on xp

    Please use code tags, then tell us what actually happens on xp
    Josie

    if at first you don't succeed try doing it the way your wife told you to

+ 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