0

Here's the deal: I had a excel table that fulfills a MySQL table. I already made a procedure in server side who receives the sheet, read it and put it on the database. Saddly the sheet and data table doesn't have the same structure, so I need to use a php object/script in server side to manipulate it. I have a interface to upload the file (excel file), so the PHP program can read it...

...but my boss job isn't make my life easier, is it? NO! He says that is a lot of work have to upload every excel file by the web interface. So, he asked me to make a button in the sheet that he might click after his "job" is done. That would replace the web interface. But, the system itself is a interface that would be saled one day (well, it's the plan!). So, I just can't just role out the web interface.

WHAT I'M ASKING IS: There's a way that I could send a file (the sheet itself) in a post method straight from the VBA Macro without using XML files and name each data that I'm sending, like a form post?

So far, I've found some tutorials or even some SO posts that made me get somewhere. But all of them were talking about a XML, and I already have a method that receives a HTTP POST (from a form) and work. I aiming to reuse the same method. From my VBA script I'm already able to make the request (not a big deal) and post it. But, in the server-side script, I'm expecting a POST come out from a form, so it calls a field's name. I don't seen to be able to do that from a VBA post. =/

3
  • 2
    You can use an XMLHttp object to POST data to a web server. Despite its name it does not require that you post the data in XML format... Short example: stackoverflow.com/questions/2773673/creating-a-post-body-in-vba Jul 17, 2013 at 18:14
  • In that example, you will pass the data through URL or am I wrong? Jul 17, 2013 at 18:26
  • Post method doesn't pass data via the URL - it goes in the request body. GET uses the URL to pass data. Jul 17, 2013 at 19:55

1 Answer 1

3

Here's the answer... the two first functions/methods define how to send a file to a web service. You only need the file path and the URL from service. It has answered even more than I expected. :D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.