Hi ,
I also used the code which opens cmd inside the vba to insert a image .But as of now I'm taking the file with the help of filedialog and storing the path in a variable called sfile and I need to pass the value this sfile variable inside curl command. I tried every possible options but it is not substituting the sfile file inside the command.Can you please help me to resolve this. Please find the code below.Error is in the command highlighted below.
>>> use code - tags <<<
I also used the code which opens cmd inside the vba to insert a image .But as of now I'm taking the file with the help of filedialog and storing the path in a variable called sfile and I need to pass the value this sfile variable inside curl command. I tried every possible options but it is not substituting the sfile file inside the command.Can you please help me to resolve this. Please find the code below.Error is in the command highlighted below.
>>> use code - tags <<<
Code:
Dim fd As Office.FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
Application.DisplayAlerts = False
Application.EnableEvents = False
With fd
.Filters.Clear
.Title = "Select a CSV file to Upload"
.Filters.Add "CSV", "*.csv", 1
.AllowMultiSelect = False
Dim sFile As String
If .Show = True Then
sFile = .SelectedItems(1)
End If
End With
Dim strCmd As String
strCmd = Environ$("comspec") & " /c curl -F fileToUpload=@'$sFile' -H Accept:text/html,application/xhtml+xml,application/xml http://00.000.00.000:0000/data/import_csv/"
Shell strCmd, vbNormalFocus
MsgBox (strCmd)
Last edited by a moderator: