T O P I C R E V I E W |
aplotnikov |
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 |
5 L A T E S T R E P L I E S (Newest First) |
cpyang |
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
|
aplotnikov |
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 |
yuki_wu |
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 |
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. |
cpyang |
Posted - 03/28/2017 : 07:30:57 AM define functions instead of macros after @global=1, see
http://www.originlab.com/doc/Quick-Help/Global-Constants
CP
|
|
|