VBA-Excel in Laravel [duplicate] - laravel

I have an excel file that has macro enabled VBA. It has a button that will trigger the VBA for my excel. I was just wondering if it is available to trigger a VBA in Laravel app. I have like an upload button in laravel but when i click it, it will first trigger the button in excel that triggers the VBA then it will read the upload excel function. Do you think it is possible? And how?

Well as long as using Internet Explorer you can use JavaScript on your button to call a macro:
<input type="button" value="Run My Macro" onclick="RunMacro("C:\MyFile.xlsm", "ThisIsMyMacro");">
And using this function:
<script type="text/javascript" language="javascript">
function RunMacro(FileName, MacroName)
{
var ExApp;
ExApp = new ActiveXObject("Excel.Application");
ExApp.Workbooks.Open(FileName);
ExApp.Run(MacroName);
}
</script>
Then you need to wait until the macro is finished and trigger the upload event with JavaScript. Not sure about how we can detect that the macro has finished. Probably the easiest way would be to have one button to trigger the macro and then let the user click another button for uploading when the macro finished.
Another solution could be having a link that opens the file and it runs a macro on the Workbook_Open() event: Open excel file through normal html link.
So the user needs to click that link before he can use the upload button.

Related

How to call golang function in dialog from JS script

I am trying to build a UI using GO and Sciter JS
When button is clicked on the Sciter UI need to call a function in GO. Please help as I did not find any documentation on this.
Regards,
SK

How to run two functions from one button in crm

I am using ribbon workbench and I need my customize button to activate two functions :
JS function
save function - that is already used in vanilla save button.
In ribbon workbench I connected my js function to my button - it works, to connect the Crm save function :
I inserted to Misc > Command core -> this func: Mscrm.SavePrimary
When I click my button the js function works but nothing is saved and I get a massage that my data is not saved, it seems that the crm function: Mscrm.SavePrimary, was fired but wasn't complete.
Is connecting these two functions to one button is possible?
If it's possible what is the right way?
The right way would be to use the Save function that is in SDK:
https://msdn.microsoft.com/pl-pl/library/gg334720.aspx#Anchor_8
Xrm.Page.data.entity.save() is equivalent of "Save" command that you have on command bar. What are you currently doing is not supported customization and is likely to stop working after any upgrade of the system
For people using Dynamics 365 Online version 9.x and later, save function is changed a little bit:
https://learn.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/formcontext-data/save
formContext.data.save(saveOptions).then(successCallback, errorCallback);

N2CMS: how to add popup conent

I have a news-type website that I am looking to create using N2CMS, but besides the regular operations (being able to see a calendar, viewing lists of news, viewing news details etc.), part of the content in the website is displayed in "modal" popups (similar to the ModalPopupExtender from the AjaxToolkit) inside the page (for example if you click Login, a popup panel appears with the login controls).
My question is: is there a way of adding a handler for a link, and displaying a "modal" popup when the link is clicked? If so, can this be done from the template GUI editor (and how)?
Thank you
N2CMS doesn't have any built-in handlers to create modal pop-ups for links. However, N2CMS does ship with the Jquery JavaScript library. My suggestion would be to use JavaScript in your site template to select and format the desired links with modal dialogs -- but that can't be done from the GUI editor, you'd need to do it in the template code directly.

attach valums jquery ajax uploader to element

by default valums ajax uploader uploaded creates a button for you. clicking the button opens "file explorer". once a file is selected it automatically uploads it for you. However I would like to have "<input id="fileUpload" type="file" />" and then a button underneath that would say "upload". Then clicking on the button would upload the file. I know it's doable but i can't figure it out. please help. thanks
The jQuery form plugin might work better for you. http://jquery.malsup.com/form/#file-upload

Firefox crashes with mulitple Uploadify JQuery browse buttons and ajax

I'm using four JQuery Uploadify browse buttons on a page that's calling the Uploadify code/buttons through Ajax. We have a javascript function called from onComplete which refreshes the Ajax page. The problem we're encountering is that when you start uploading one file, if you click browse to upload another file, Firefox will crash when selecting the second file.
Any help is appreciated.
Thanks!
The solution I ended up with was to just hide the other buttons while an upload is in progress.
Is there a reason you wouldn't use the built-in multiple-file upload functionality that Uploadify allows? In most cases it's as simple as setting:
'multi' : true

Resources