HOW TO: Open an Excel File with an Open Dialog box -Excel VBA

preview_player
Показать описание
Real Simple stuff....Dialog File Picker throwing in an Scripting.FileSystemObject for good measure.

'------------------------------------------------------------------
Sub OPEN_SOME_STUFF()

Dim FSO As Object
Dim FD As Object

Set FD = Application.FileDialog(msoFileDialogFilePicker)

If FD.Show = -1 Then

Filename = FD.SelectedItems(1)

Filename = FSO.getfile(Filename)

Workbooks.Open (Filename)

End If
End Sub

'----------------------------------------------------
Рекомендации по теме
Комментарии
Автор

Hi,
I have a button called UpLoad on my webpage which ask to upload the .csv file.
I am able to click that button using VBA code and after clicking that button on webpage a popup appears similar to open dialog box which ask to upload a file for example say "Star.csv" but i want to insert the file name called "Star.csv" which is stored in my local directory automatically using VBA without user interaction.

Any help will be appreciated .
Thanks!

amitbodhwani
Автор

Are you teaching to yourself .Pathetic explain the meaning of the syntax

ManojYadav-ntrm