Author |
Topic |
|
aplotnikov
Germany
162 Posts |
Posted - 03/28/2017 : 06:58:02 AM
|
Origin Ver. and Service Release: Pro 8.6.0 64-bit SR3 b99 Operating System: Win 7 Pro SP1
Hello,
I define a number of macros in ProjectEvents script (section AfterOpenDoc), however it works only partially - some of the defined macros do not exist after the script execution. If I copy any of the non-executed macro definitions from ProjectEvents and execute it in a command line, everything works fine (i.e., definitions contain no errors).
Are there any limitations on the use of macro definitions in ProjectEvents scripts? What is the most reliable approach to define maсros immediately after the project opening?
Thanks in advance,
Alexei |
|
cpyang
USA
1406 Posts |
|
aplotnikov
Germany
162 Posts |
Posted - 03/28/2017 : 07:35:43 AM
|
Sorry, i haven't mentioned, that the @global-variable was always set to 1. Ok, thanks for advise, I'll try to define functions.
In addition: the use of functions instead of macros does not help. The problem remains. |
Edited by - aplotnikov on 03/28/2017 09:14:45 AM |
|
|
yuki_wu
896 Posts |
Posted - 03/29/2017 : 05:10:25 AM
|
Hi Alexei,
Firstly, I want to confirm that you have modified and saved the REAL ProjectEvents.ogs file. Please open your project, and then open the Code Builder. In Code Builder, go to Workspace panel, double click the tree node ProjectEvents.OGS to open this file instead of finding it in Text Editor.
If you make sure you have changed to define functions in the real ProjectEvents.ogs file, and the problem hasn’t gone, would you mind sending you OPJ to us for further check? (tech@originlab.com)
Regards, Yuki OriginLab
|
|
|
aplotnikov
Germany
162 Posts |
Posted - 03/29/2017 : 05:53:42 AM
|
Hi Yuki,
Surely it was the REAL ProjectEvents.ogs - I used type -b "..." to control the execution. I found that the problem was caused by a "[Workbook_Name]1!"-construction used to set wks.export-parameters (the workbook name itself does not matter). But if you execute the same code in command line, everything works fine. So, I can simply avoid this construction, but it looks a little bit strange...
Kind regards,
Alexei |
Edited by - aplotnikov on 03/29/2017 05:55:37 AM |
|
|
cpyang
USA
1406 Posts |
Posted - 03/29/2017 : 3:46:04 PM
|
If you don't mind, can you share the few line of codes that demonstrate this problem? Basically range defined for a worksheet has issue when called from inside a function?
CP
|
|
|
|
Topic |
|