I have three files one is a excel file enabled with macro where my macro is(1), the csv file to run the macro on(2). The new csv file that would be opened(3)
I am new to userform I created a web browser control and was able to initialize in the userform and added the code
Private Sub UserForm_Initialize()
Me.WebBrowser1.Navigate "http://sharepoint_site.aspx"
End Sub
now when I click on the required csv file I get file download. There how do I just open the file and make this newly opened csv file as active? There are many csv files on the sharepoint site.The user selects a specific file and gets a file download box where it should jusst open that csv file. The reason for using userform as suggested by @David was to better control the newly opened CSV file and have the name of the file stored to perform the next steps of the code rather than file 2 where the macro is run to be the active workbook.Below code was my previous code which was part of a case statement.
Dim IE As Object
Set IE = CreateObject("InternetExplorer.application")
With IE
.Visible = True
.navigate ("https://site.aspx")
MsgBox "Select the file and click open file"
Here obviously activated the file (2) where the macro ran but wanted to activate the newly opened file. Any help on this is greatly appreciated & thank you in advance.