PassSystems
New Member
- Joined
- Sep 19, 2020
- Messages
- 12
- Office Version
- 365
- Platform
- Windows
Hi, I am generating a spreadsheet for my business and would like to open multiple workbooks as separate instances of excel.
The reason I want to do this is to remove the potential for memory crash. The spreadsheet is userform, graphic and data heavy so want to ensure I don't come across the dreaded not enough memory error by splitting it up into multiple workbooks. I am running 64bit but still want to split up the workbooks because it opens up other options to improve its usability.
I already have the code set up to obtain both the full file name with path included and the filename only (see below). I am looking for the VBA code to open the file/s in separate instances of excel.
Dim FileName As Variant
Dim FileNameFull As Variant
' Allows the user to select the client data file name, with path and saves it to the cell "B4" in the "Data" worksheet
' Also sets the Me.TextFullFile.Value as the client file name with path information.
FileNameFull = Application.GetOpenFilename(Filefilter:="Excel Files,*.xls*")
If FileNameFull = "False" Then
Me.Text_FileName = "Select Data File Before Continuing"
Else
Me.TextFullFile.Value = FileNameFull
ThisWorkbook.Sheets("Data").Range("B4").Value = Me.TextFullFile.Value
End If
' Removes the path details and saves the file name only to the cell "B3" in the "Data" worksheet
' Also sets the Me.Text_FileName.Value as the client file name without path information.
FileName = Mid(FileNameFull, InStrRev(FileNameFull, "\") + 1)
If FileName = "False" Then
Me.Text_FileName = "Select Data File Before Continuing"
Else
Me.Text_FileName.Value = FileName
ThisWorkbook.Sheets("Data").Range("B3").Value = Me.Text_FileName.Value
End If
Your help would be greatly appreciated.
The reason I want to do this is to remove the potential for memory crash. The spreadsheet is userform, graphic and data heavy so want to ensure I don't come across the dreaded not enough memory error by splitting it up into multiple workbooks. I am running 64bit but still want to split up the workbooks because it opens up other options to improve its usability.
I already have the code set up to obtain both the full file name with path included and the filename only (see below). I am looking for the VBA code to open the file/s in separate instances of excel.
Dim FileName As Variant
Dim FileNameFull As Variant
' Allows the user to select the client data file name, with path and saves it to the cell "B4" in the "Data" worksheet
' Also sets the Me.TextFullFile.Value as the client file name with path information.
FileNameFull = Application.GetOpenFilename(Filefilter:="Excel Files,*.xls*")
If FileNameFull = "False" Then
Me.Text_FileName = "Select Data File Before Continuing"
Else
Me.TextFullFile.Value = FileNameFull
ThisWorkbook.Sheets("Data").Range("B4").Value = Me.TextFullFile.Value
End If
' Removes the path details and saves the file name only to the cell "B3" in the "Data" worksheet
' Also sets the Me.Text_FileName.Value as the client file name without path information.
FileName = Mid(FileNameFull, InStrRev(FileNameFull, "\") + 1)
If FileName = "False" Then
Me.Text_FileName = "Select Data File Before Continuing"
Else
Me.Text_FileName.Value = FileName
ThisWorkbook.Sheets("Data").Range("B3").Value = Me.Text_FileName.Value
End If
Your help would be greatly appreciated.