Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have set of .xls files want to convert to csv because of some issue in loading. I have a script to read file by file then call macro code with in that loop. Problem is I am passing file into variable and passing that variable value into macro. Understand active document wont work with in macro, is there any alternate for this ? Below is my macro code:
strValueToDisplay = ActiveDocument.Variables("vFile").GetContent().String
vFile have file path and name. On edit module --> its working fine. However calling macro from script is not working. Please advice.
Thanks,
Pavan
Pass your variable value as a string to the Function. ie in the script:
LET vExecFunction = RepairXLS('$(vFile)');
and in the module:
function RepairXLS(myfile)
-Rob
May be this? I've remove the () from extension of GetContent..
strValueToDisplay = ActiveDocument.Variables("vFile").GetContent.String
Hi Anil,
It did not work. Understand with in community that, if we call macro with in script with ActiveDocument it wont work.
Attached document for your reference. The objective of the document is
1. Read .XLS file
2. Assign the filename with path to a variable
3. call macro function to convert the XLS to cls.
Edit module --> Test is working fine. But when I call the same macro from script is not working. I guess its because of ActiveDocument.
Thanks,
Pavan
Pass your variable value as a string to the Function. ie in the script:
LET vExecFunction = RepairXLS('$(vFile)');
and in the module:
function RepairXLS(myfile)
-Rob
Thanks Rob it worked.
Regards,
Pavan Ch