+ Reply to Thread
Results 1 to 8 of 8

Macro transfer to another computer

  1. #1
    Registered User
    Join Date
    07-23-2014
    Location
    Tucson, AZ
    MS-Off Ver
    2013
    Posts
    10

    Macro transfer to another computer

    Hello, I recently created a macro that I need several other users to access and use. I exported it on my computer and imported on the other user's computer successfully but when the macro is ran on the other user's computer it gives her an debug error. I have run it several times on my computer without any issues. Any idea why this would be happening? Any suggestions on how to fix it?

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Macro transfer to another computer

    It could be for a number of reasons.

    Does the other user have a different version of Excel?

    Do you use any controls/add-ins/whatever that aren't available, or aren't installed, on the other user's computer?

    Is the macro workbook specific?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    07-23-2014
    Location
    Tucson, AZ
    MS-Off Ver
    2013
    Posts
    10

    Re: Macro transfer to another computer

    Hi Norie, she recently updated to the same version of excel (2013) and as far as I know its all simple formatting of a document (column width, text size, etc.) and no the macro is not workbook specific I created it so that when they download data the formatting is uniformed across 3 different users.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Macro transfer to another computer

    Does the code fail for the other user on specific workbooks or all workbooks?

    Can you post the code and indicate where it's failing?

  5. #5
    Registered User
    Join Date
    07-23-2014
    Location
    Tucson, AZ
    MS-Off Ver
    2013
    Posts
    10

    Re: Macro transfer to another computer

    Here is the code, the error happens where the GREEN text is.
    '
    ' Keyboard Shortcut: Ctrl+o
    '
    Cells.Select
    Selection.Copy
    Sheets.Add After:=ActiveSheet
    ActiveSheet.Paste
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Columns("A:B").Select
    Application.CutCopyMode = False
    Selection.Delete Shift:=xlToLeft
    Range("C:C,F:F").Select
    Range("F1").Activate
    With Selection
    .HorizontalAlignment = xlCenter
    .VerticalAlignment = xlBottom
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder = xlContext
    .MergeCells = False
    End With
    With Selection
    .HorizontalAlignment = xlCenter
    .VerticalAlignment = xlBottom
    .WrapText = True
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder = xlContext
    .MergeCells = False
    End With
    Columns("I:K").Select
    Selection.Delete Shift:=xlToLeft
    Columns("G:H").Select
    Selection.Style = "Currency"
    Columns("E:E").Select
    With Selection
    .HorizontalAlignment = xlGeneral
    .VerticalAlignment = xlBottom
    .WrapText = True
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder = xlContext
    .MergeCells = False
    End With
    Range("A1").Select
    ActiveSheet.ListObjects.Add(xlSrcRange, Range("$A$1:$H$67"), , xlYes).Name = _
    "Table3"
    Columns("C:C").Select
    Selection.ColumnWidth = 16.14
    Selection.ColumnWidth = 14.43
    Cells.Select
    Cells.EntireColumn.AutoFit
    Range("Table3[[#Headers],[FOLIO]]").Select
    Columns("E:E").ColumnWidth = 61
    Cells.Select
    Cells.EntireRow.AutoFit
    Columns("D:D").Select
    With Selection
    .HorizontalAlignment = xlGeneral
    .VerticalAlignment = xlBottom
    .WrapText = True
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder = xlContext
    .MergeCells = False
    End With
    Selection.ColumnWidth = 36.71
    Cells.Select
    Cells.EntireRow.AutoFit
    Range("Table3[[#Headers],[FOLIO]]").Select
    Application.PrintCommunication = False
    With ActiveSheet.PageSetup
    .PrintTitleRows = ""
    .PrintTitleColumns = ""
    End With
    Application.PrintCommunication = True
    ActiveSheet.PageSetup.PrintArea = ""
    Application.PrintCommunication = False
    With ActiveSheet.PageSetup
    .LeftHeader = ""
    .CenterHeader = ""
    .RightHeader = ""
    .LeftFooter = ""
    .CenterFooter = ""
    .RightFooter = ""
    .LeftMargin = Application.InchesToPoints(0.7)
    .RightMargin = Application.InchesToPoints(0.7)
    .TopMargin = Application.InchesToPoints(0.75)
    .BottomMargin = Application.InchesToPoints(0.75)
    .HeaderMargin = Application.InchesToPoints(0.3)
    .FooterMargin = Application.InchesToPoints(0.3)
    .PrintHeadings = False
    .PrintGridlines = False
    .PrintComments = xlPrintNoComments
    .PrintQuality = 600
    .CenterHorizontally = False
    .CenterVertically = False
    .Orientation = xlLandscape
    .Draft = False
    .PaperSize = xlPaperLetter
    .FirstPageNumber = xlAutomatic
    .Order = xlDownThenOver
    .BlackAndWhite = False
    .Zoom = 100
    .PrintErrors = xlPrintErrorsDisplayed
    .OddAndEvenPagesHeaderFooter = False
    .DifferentFirstPageHeaderFooter = False
    .ScaleWithDocHeaderFooter = True
    .AlignMarginsHeaderFooter = True
    .EvenPage.LeftHeader.Text = ""
    .EvenPage.CenterHeader.Text = ""
    .EvenPage.RightHeader.Text = ""
    .EvenPage.LeftFooter.Text = ""
    .EvenPage.CenterFooter.Text = ""
    .EvenPage.RightFooter.Text = ""
    .FirstPage.LeftHeader.Text = ""
    .FirstPage.CenterHeader.Text = ""
    .FirstPage.RightHeader.Text = ""
    .FirstPage.LeftFooter.Text = ""
    .FirstPage.CenterFooter.Text = ""
    .FirstPage.RightFooter.Text = ""
    End With
    Application.PrintCommunication = True
    Application.PrintCommunication = False
    With ActiveSheet.PageSetup
    .PrintTitleRows = ""
    .PrintTitleColumns = ""
    End With
    Application.PrintCommunication = True
    ActiveSheet.PageSetup.PrintArea = ""
    Application.PrintCommunication = False
    With ActiveSheet.PageSetup
    .LeftHeader = ""
    .CenterHeader = ""
    .RightHeader = ""
    .LeftFooter = ""
    .CenterFooter = ""
    .RightFooter = ""
    .LeftMargin = Application.InchesToPoints(0.17)
    .RightMargin = Application.InchesToPoints(0.17)
    .TopMargin = Application.InchesToPoints(0.75)
    .BottomMargin = Application.InchesToPoints(0.25)
    .HeaderMargin = Application.InchesToPoints(0.3)
    .FooterMargin = Application.InchesToPoints(0.3)
    .PrintHeadings = False
    .PrintGridlines = False
    .PrintComments = xlPrintNoComments
    .PrintQuality = 600
    .CenterHorizontally = False
    .CenterVertically = False
    .Orientation = xlLandscape
    .Draft = False
    .PaperSize = xlPaperLetter
    .FirstPageNumber = xlAutomatic
    .Order = xlDownThenOver
    .BlackAndWhite = False
    .Zoom = 100
    .PrintErrors = xlPrintErrorsDisplayed
    .OddAndEvenPagesHeaderFooter = False
    .DifferentFirstPageHeaderFooter = False
    .ScaleWithDocHeaderFooter = True
    .AlignMarginsHeaderFooter = True
    .EvenPage.LeftHeader.Text = ""
    .EvenPage.CenterHeader.Text = ""
    .EvenPage.RightHeader.Text = ""
    .EvenPage.LeftFooter.Text = ""
    .EvenPage.CenterFooter.Text = ""
    .EvenPage.RightFooter.Text = ""
    .FirstPage.LeftHeader.Text = ""
    .FirstPage.CenterHeader.Text = ""
    .FirstPage.RightHeader.Text = ""
    .FirstPage.LeftFooter.Text = ""
    .FirstPage.CenterFooter.Text = ""
    .FirstPage.RightFooter.Text = ""
    End With
    Application.PrintCommunication = True
    Application.PrintCommunication = False
    With ActiveSheet.PageSetup
    .PrintTitleRows = ""
    .PrintTitleColumns = ""
    End With
    Application.PrintCommunication = True
    ActiveSheet.PageSetup.PrintArea = ""
    Application.PrintCommunication = False
    With ActiveSheet.PageSetup
    .LeftHeader = ""
    .CenterHeader = ""
    .RightHeader = ""
    .LeftFooter = ""
    .CenterFooter = ""
    .RightFooter = ""
    .LeftMargin = Application.InchesToPoints(0.17)
    .RightMargin = Application.InchesToPoints(0.17)
    .TopMargin = Application.InchesToPoints(0.75)
    .BottomMargin = Application.InchesToPoints(0.25)
    .HeaderMargin = Application.InchesToPoints(0.3)
    .FooterMargin = Application.InchesToPoints(0.3)
    .PrintHeadings = False
    .PrintGridlines = False
    .PrintComments = xlPrintNoComments
    .PrintQuality = 600
    .CenterHorizontally = False
    .CenterVertically = False
    .Orientation = xlLandscape
    .Draft = False
    .PaperSize = xlPaperLetter
    .FirstPageNumber = xlAutomatic
    .Order = xlDownThenOver
    .BlackAndWhite = False
    .Zoom = False
    .FitToPagesWide = 1
    .FitToPagesTall = 0
    .PrintErrors = xlPrintErrorsDisplayed
    .OddAndEvenPagesHeaderFooter = False
    .DifferentFirstPageHeaderFooter = False
    .ScaleWithDocHeaderFooter = True
    .AlignMarginsHeaderFooter = True
    .EvenPage.LeftHeader.Text = ""
    .EvenPage.CenterHeader.Text = ""
    .EvenPage.RightHeader.Text = ""
    .EvenPage.LeftFooter.Text = ""
    .EvenPage.CenterFooter.Text = ""
    .EvenPage.RightFooter.Text = ""
    .FirstPage.LeftHeader.Text = ""
    .FirstPage.CenterHeader.Text = ""
    .FirstPage.RightHeader.Text = ""
    .FirstPage.LeftFooter.Text = ""
    .FirstPage.CenterFooter.Text = ""
    .FirstPage.RightFooter.Text = ""
    End With
    Application.PrintCommunication = True
    Rows("1:1").Select
    Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
    Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
    Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
    Range("G1").Select
    ActiveCell.FormulaR1C1 = "Total Reembolsable:"
    Range("G2").Select
    ActiveCell.FormulaR1C1 = "Total N/R:"
    Range("G1:H2").Select
    Selection.Font.Bold = True
    Selection.Font.Size = 12
    Range("G1:G2").Select
    With Selection
    .HorizontalAlignment = xlRight
    .VerticalAlignment = xlBottom
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder = xlContext
    .MergeCells = False
    End With
    Range("H1").Select
    ActiveCell.FormulaR1C1 = "=SUM(R[4]C[-1]:R[99999]C[-1])"
    Range("H2").Select
    ActiveCell.FormulaR1C1 = "=SUM(R[3]C:R[99998]C)"
    Range("A1").Select
    ActiveWindow.View = xlPageLayoutView
    Selection.Font.Bold = True
    Selection.Font.Size = 12
    Selection.Font.Bold = True
    Selection.Font.Size = 12
    Selection.Font.Size = 14
    Selection.Font.Bold = True
    Selection.Font.Size = 12
    Selection.Font.Size = 11
    Selection.Font.Size = 12
    Application.PrintCommunication = False
    With ActiveSheet.PageSetup
    .LeftHeader = "&""-,Bold""&12Junio Semana 1"
    .CenterHeader = "&""-,Bold""&14Gastos Reembolsables"
    .RightHeader = "&""-,Bold""&12 12.0081" & Chr(10) & "Morelos"
    .LeftFooter = ""
    .CenterFooter = ""
    .RightFooter = ""
    .LeftMargin = Application.InchesToPoints(0.17)
    .RightMargin = Application.InchesToPoints(0.17)
    .TopMargin = Application.InchesToPoints(0.75)
    .BottomMargin = Application.InchesToPoints(0.25)
    .HeaderMargin = Application.InchesToPoints(0.3)
    .FooterMargin = Application.InchesToPoints(0.3)
    .Zoom = 77
    .PrintErrors = xlPrintErrorsDisplayed
    .OddAndEvenPagesHeaderFooter = False
    .DifferentFirstPageHeaderFooter = False
    .ScaleWithDocHeaderFooter = True
    .AlignMarginsHeaderFooter = True
    .EvenPage.LeftHeader.Text = ""
    .EvenPage.CenterHeader.Text = ""
    .EvenPage.RightHeader.Text = ""
    .EvenPage.LeftFooter.Text = ""
    .EvenPage.CenterFooter.Text = ""
    .EvenPage.RightFooter.Text = ""
    .FirstPage.LeftHeader.Text = ""
    .FirstPage.CenterHeader.Text = ""
    .FirstPage.RightHeader.Text = ""
    .FirstPage.LeftFooter.Text = ""
    .FirstPage.CenterFooter.Text = ""
    .FirstPage.RightFooter.Text = ""
    End With
    Application.PrintCommunication = True
    Range("A1").Select
    End Sub

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Macro transfer to another computer

    Accidental duplicate.

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Macro transfer to another computer

    What happens if you comment out the offending line and the one following it?

    Also, if there are any other instances of Application.PrintCommunication = True/False comment them out too.

    PS Is the user having the problem connected to a printer?

    PPS Can you add code tags when posting code?

  8. #8
    Registered User
    Join Date
    07-23-2014
    Location
    Tucson, AZ
    MS-Off Ver
    2013
    Posts
    10

    Re: Macro transfer to another computer

    The user having the problem is connected to a printer, probably to several network printers as we all are. I commented out all the Application.PrintCommunication =True out of the code and that ran the macro all the way through without errors but the formatting is still not completely correct when its done running. I will continue to work with it now to smooth it all out. Thank you for your help!

    P.S. Sorry I will use code tags on future posts! Thanks!

+ 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. Is there any way to transfer Macros to another computer?
    By inerstrength in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-08-2014, 03:31 AM
  2. Transfer Macro code to another computer
    By Corey in forum Excel General
    Replies: 0
    Last Post: 05-24-2006, 06:15 PM
  3. Replies: 0
    Last Post: 05-17-2006, 08:45 AM
  4. [SOLVED] How to transfer Macro to other computer?
    By Adrian in forum Excel General
    Replies: 3
    Last Post: 12-14-2005, 11:10 PM
  5. [SOLVED] Can I transfer excel from one computer to another?
    By kaboose in forum Excel General
    Replies: 1
    Last Post: 05-12-2005, 10:07 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