1

I have written a simple ASP.NET MVC 2 application that stores data and can dynamically create excel files using Microsoft's openXML for excel files.

What is the best way to push changes the user makes in excel to my database? I know it can be done via file upload, but this is rather obtrusive to the end user to navigate to my site, select upload, and then select their file.

Is there a way to do 1 click publishing from the excel file using VBA? VBA can interact with the database directly, but this seems dangerous from a data security standpoint, and duplication of logic.

Do web services work with the MVC architecture? How do I get a vba macro enabled document to send itself to the server?

3
  • are you serious - a document that sends itself ? that would be a HUGE security issue! Commented Nov 7, 2011 at 13:39
  • @Yahia How so? Isn't it just automating the user uploading the file via their web browser and the site? Commented Nov 7, 2011 at 13:42
  • 1
    For the upload to succeed you need to authenticate on the server which means that this information is somehow built into the VBA... you could try to work with "one-time-tokens" or similar Commented Nov 7, 2011 at 13:52

3 Answers 3

1

For anyone out there looking for a fix, I ended up using vba's InternetExplorer.Application object and interacting with an upload form on my site.

For more info on the upload form check out: http://haacked.com/archive/2010/07/16/uploading-files-with-aspnetmvc.aspx

For more info on VBA and the InternetExplorer.Application object check out: www.motobit.com/tips/detpg_uploadvbaie/

Sign up to request clarification or add additional context in comments.

1 Comment

If you got an answer to your question, you should mark it as the answer, even if you answered it yourself :)
0

You might take a look at Sql server integration services for bulk upload of data into sql server. The integration services once created can be run using a normal c# desktop program or using a windows service. But you might

  • need to make sure this happens in the background and will have to be an asynchronous task.
  • also need to make sure it is properly secured by not giving direct execute access to any other users

Comments

0

I'm assuming that this is for a specific user. I've done something very similar to what you are describing before.

Tell the user to save the excel file in their DropBox and share the file with you. Have the server listen for changes to this file and run a server side routine to import the data.

Disclaimer: This is not a secure solution, but it's easy and will get the job done.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.