My macros won't work on other computers when I email them to someone else. They only work on my computer.

biancam3392

New Member
Joined
Apr 22, 2015
Messages
1
I have an excel file that multiple people need to access. However, the file only works on my computer. When someone else opens the file it gives this error message:

"Sorry we could not find your file. Is it possible it was moved, renamed or deleted?"

It's so annoying considering I spent hours on it. We all have the same version of excel and it is a "xism" file so macros should be enabled. I am for sure the person I am sending it to saved it as an "xlsm" as well. What could possibly be the error? I will post my code below, there is a lot.

(Just FYI, there is also a Personal.xlsb" file that opens every time I open excel also.)

Here's my code:




Private Sub Worksheet_Change(ByVal Target As Range)

If Not Intersect(Target, Range("I8")) Is Nothing Then
Application.Run "'PPR1&2.xlsm'!HideRows"
End If
End Sub

------------------------------------------------------------------------

Sub HideRows()

If Range("I8") = "Viability" Then
Range("10:11").EntireRow.Hidden = False
Else
Range("10:11").EntireRow.Hidden = True
End If

If Range("I8") = "Cost" Then
Range("30:35").EntireRow.Hidden = False
Else
Range("30:35").EntireRow.Hidden = True
End If

End Sub
---------------------------------------------------------------
Sub Message()

MsgBox "Submitted!"

End Sub
-------------------------------------------------------------

Sub Submit()

Application.ScreenUpdating = False

If ActiveSheet.Range("I8").Value = "" Then
MsgBox "Incomplete: Please enter in all of the required information to proceed."
Exit Sub
End If

If ActiveSheet.Range("I8").Value = "Viability" Then
Range("I30:L30").ClearContents
Range("I32:L32").ClearContents
Range("I34:L34").ClearContents

If Range("I10") = Empty Then
MsgBox "Incomplete: Please enter in all of the required information to proceed."
Exit Sub
End If
End If

If ActiveSheet.Range("I8").Value = "Cost" Then
Range("I10:L10").ClearContents

If Range("I30") = Empty Then
MsgBox "Incomplete: Please enter in all of the required information to proceed."
Exit Sub
End If

If Range("I32") = Empty Then
MsgBox "Incomplete: Please enter in all of the required information to proceed."
Exit Sub
End If

If Range("I34") = Empty Then
MsgBox "Incomplete: Please enter in all of the required information to proceed."
Exit Sub
End If
End If

If ActiveSheet.Range("I8").Value = "Capacity" Then
Range("I10:L10").ClearContents
Range("I30:L30").ClearContents
Range("I32:L32").ClearContents
Range("I34:L34").ClearContents
End If

If ActiveSheet.Range("I12").Value = "" Then
MsgBox "Incomplete: Please enter in all of the required information to proceed."
Exit Sub
End If

If ActiveSheet.Range("I14").Value = "" Then
MsgBox "Incomplete: Please enter in all of the required information to proceed."
Exit Sub
End If

If ActiveSheet.Range("I16").Value = "" Then
MsgBox "Incomplete: Please enter in all of the required information to proceed."
Exit Sub
End If

If ActiveSheet.Range("I18").Value = "" Then
MsgBox "Incomplete: Please enter in all of the required information to proceed."
Exit Sub
End If

If ActiveSheet.Range("I21").Value = "" Then
MsgBox "Incomplete: Please enter in all of the required information to proceed."
Exit Sub
End If

If ActiveSheet.Range("I24").Value = "" Then
MsgBox "Incomplete: Please enter in all of the required information to proceed."
Exit Sub
End If

If ActiveSheet.Range("I26").Value = "" Then
MsgBox "Incomplete: Please enter in all of the required information to proceed."
Exit Sub
End If

If ActiveSheet.Range("I28").Value = "" Then
MsgBox "Incomplete: Please enter in all of the required information to proceed."
Exit Sub
End If

If ActiveSheet.Range("I36").Value = "" Then
MsgBox "Incomplete: Please enter in all of the required information to proceed."
Exit Sub
End If

If ActiveSheet.Range("I38").Value = "" Then
MsgBox "Incomplete: Please enter in all of the required information to proceed."
Exit Sub
End If

If ActiveSheet.Range("I40").Value = "" Then
MsgBox "Incomplete: Please enter in all of the required information to proceed."
Exit Sub
End If

Application.ScreenUpdating = False
Application.Run "'PPR1&2.xlsm'!Transfer"
Application.Run "'PPR1&2.xlsm'!Message"


End Sub

-------------------------------------------------------------------

Sub Transfer()
'
' Submit Macro
'

'
Sheets("PPR").Select
Range("I8:L8").Select
Selection.Copy
Sheets("PPR List").Select
Range("A" & Rows.Count).End(xlUp).Offset(1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("PPR").Select 'B
Range("I10:L10").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PPR List").Select
Range("A4").Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 1).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("PPR").Select
Range("I12:L12").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PPR List").Select
Range("C" & Rows.Count).End(xlUp).Offset(1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("PPR").Select
Range("I14:L14").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PPR List").Select
Range("D" & Rows.Count).End(xlUp).Offset(1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("PPR").Select
Range("I16:L16").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PPR List").Select
Range("E" & Rows.Count).End(xlUp).Offset(1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("PPR").Select
Range("I18:P19").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PPR List").Select
Range("F" & Rows.Count).End(xlUp).Offset(1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("PPR").Select
Range("I21:P22").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PPR List").Select
Range("G" & Rows.Count).End(xlUp).Offset(1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("PPR").Select
Range("I24:N24").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PPR List").Select
Range("H" & Rows.Count).End(xlUp).Offset(1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("PPR").Select
Range("I26:N26").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PPR List").Select
Range("I" & Rows.Count).End(xlUp).Offset(1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("PPR").Select
Range("I28:N28").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PPR List").Select
Range("J" & Rows.Count).End(xlUp).Offset(1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("PPR").Select 'K
Range("I30:L30").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PPR List").Select
Range("J4").Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 1).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("PPR").Select 'L
Range("I32:L32").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PPR List").Select
Range("J4").Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 2).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("PPR").Select 'M
Range("I34:L34").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PPR List").Select
Range("J4").Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 3).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("PPR").Select
Range("I36:L36").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PPR List").Select
Range("N" & Rows.Count).End(xlUp).Offset(1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("PPR").Select
Range("I38:L38").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PPR List").Select
Range("O" & Rows.Count).End(xlUp).Offset(1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("PPR").Select
Range("I40:L40").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PPR List").Select
Range("P" & Rows.Count).End(xlUp).Offset(1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

ActiveCell.Offset(0, 1).Range("A1").Select
Sheets("PPR").Select
Application.CutCopyMode = False
End Sub
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi and welcome to the forum.

Instead of using...
Application.Run "'PPR1&2.xlsm'!HideRows"
...use the Call method
Call HideRows
Change all of the Application.Run lines.

Also, please take note of my signature block below about the use of CODE tags. It makes reading your code much easier.
 
Upvote 0

Forum statistics

Threads
1,214,586
Messages
6,120,402
Members
448,958
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top