Hello,
I’m receiving an error when attempting to run a select part of my code. There are eight parts of my total routine. However, when testing, it appears the second portion is where my problem occurs (cmdTest2_Click).
The error is:
Here is a snipit of my code –
T5 = C:\Users\?????\Desktop\
T6 = TryMe.xlsb
I was hoping to find a way to open TryMe NOT as Read Only. I would have thought being Read Only wouldn’t matter as I am only copying from TryMe not modifying it but apparently this is not the case. Any suggestions would be appreciated.
Thanks for viewing,
Steve K.
I’m receiving an error when attempting to run a select part of my code. There are eight parts of my total routine. However, when testing, it appears the second portion is where my problem occurs (cmdTest2_Click).
The error is:
Here is a snipit of my code –
VBA Code:
Private Sub cmdTest1_Click()
Application.ScreenUpdating = False
Application.EnableEvents = False
ActiveWorkbook.Save
Range("TempCell") = "Repair"
'- - - - - - - - - - - Set variables - - - - - - - - -
Dim FilePath, FileOnly, PathOnly As String
FilePath = ThisWorkbook.FullName
FileOnly = ThisWorkbook.Name
Range("T5") = PathOnly
Range("T6") = FileOnly
Range("T16").Copy
Range("U16").PasteSpecial Paste:=xlPasteValues
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Call ClearALL
Dim aFile As String
On Error Resume Next
aFile = ActiveWorkbook.Path & Application.PathSeparator & "Amort_Temp.xlsb"
Kill aFile
ActiveWorkbook.Names("LookupDate").Delete
ActiveWorkbook.SaveAs ActiveWorkbook.Path & Application.PathSeparator & "Amort_Temp.xlsb"
End Sub
‘. . . . . . . . . . . IT APPEARS THIS IS WHERE THE PROBLEM OCCURS . . . . . . . . . . . . . . . . . . . . . . . . . .
Private Sub cmdTest2_Click()
Application.DisplayAlerts = False
Workbooks.Open("" & Range("T5") & Range("T6") & "").RunAutoMacros Which:=xlAutoOpen
End Sub
T5 = C:\Users\?????\Desktop\
T6 = TryMe.xlsb
I was hoping to find a way to open TryMe NOT as Read Only. I would have thought being Read Only wouldn’t matter as I am only copying from TryMe not modifying it but apparently this is not the case. Any suggestions would be appreciated.
Thanks for viewing,
Steve K.
Last edited: