Public Class Data Implements ICloneable Public Function Clone() As Object Implements System.ICloneable.Clone Return MyBase.MemberwiseClone() End FunctionThen, from a client class, I can do this:
Public oData As Data = New Data(oProcess) Public oDataExcel As Data = New Data(oProcess) ' Keep a reference to it as we will need to switch it back after the export oDataExcel = oData.CloneThis works. However, I just found out that this works only for the cloning of members and not the data itself. For example, in this case, I have a dataset attached to it such as oData.oDataSet. In that case, the data, if changed after the cloning has been done, will not be preserved.