Hi, I am using the following code to open another workbook, and eventually do some copy/pasting into the workbook housing the VBA code. However, I need to able to open the workbook as a read only. Can I modify the following code to achieve that?
' Get source workbook...
Dim filter As String
Dim caption As String
Dim sourceFilename As String
Dim sourceWorkbook As Workbook
Dim targetWorkbook As Workbook
' make weak assumption that active workbook is the target
Set targetWorkbook = Application.ActiveWorkbook
' get the source workbook
filter = "Excel Workbooks (*.xlsx; *.xlsm),*.xlsx;*.xslm"
caption = "Please Select an input file with the RDT."
sourceFilename = Application.GetOpenFilename(filter, , caption)
Set sourceWorkbook = Application.Workbooks.Open(sourceFilename)