Free for PREMIUM members
Learn how to a build a cloud-first strategyRegister Now
Dim SourcePath As Variant
Dim SourceWb As Workbook
Dim SourceWasOpen As Boolean
SourcePath = Application.GetOpenFilename("Excel files (*.xls*), *.xls*", , _
"Select file to process", , False)
If SourcePath = False Then
MsgBox "No file selected", vbCritical, "Aborting"
On Error Resume Next
Set SourceWb = Workbooks(Mid(SourcePath, InStrRev(SourcePath, "\") + 1))
If Err = 0 Then
SourceWasOpen = True
SourceWasOpen = False
Set SourceWb = Workbooks.Open(SourcePath)
On Error GoTo 0
' now do whatever it is you have to do
If Not SourceWasOpen Then SourceWb.Close False
Open in new window
Dim FLName As String
FLName = Application.GetOpenFilename
Range("a1").Value = FLName
Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.
.Worksheets(1).Name = "foo"
.Worksheets(.Worksheets.Count).Name = "hee"
Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.