Dom Posted February 9, 2002 Share Posted February 9, 2002 Hi, i'm trying to create a script that will update a selected worksheet automaticly then export it,I know it should be a quite simple procedure, but i don't know anything about Pascal Scripting/Vectorscript, when trying to use the DoMenuTextByName('Export Worksheet',0);i then get a message that no worksheet is active., so i tried to insert another DoMenuTextByName that would go select the worksheet via the Window Menu.. but doesn't seems to work.DoMenuTextByName('Document Windows','Worksheets',0);(it's probably a bad way to writh the path, or that since it's a variable menu with the doc name changing...) I then tried to use the SelectSS(h:'export'); command, but i can't figure out how to define/set the handler. Is it also possible to have the worksheet exporting in tab format automaticly,Just being prompted for the location where i want to save it? If anyone is willing to write that simple code for me, and explain me a little what procedure i should have used, i'd really appreciate it, the name of the worksheet i want to export will never change, it's called 'export'(without the ' ). using 8.5.2... Thanks in advance, and excuse me for any mistakes, english is not my 1st language... Dom Quote Link to comment
Fuge Posted February 10, 2002 Share Posted February 10, 2002 This should do what you want. Keep in mind that this script will work in VW8.5 but would need to be slightly changed for VW9.Dave---------------------------------------------PROCEDURE WSexport;LABEL 99;CONST WksName = 'export'; {The Worksheets name}VAR WksH : HANDLE; BEGIN WksH := Getobject ( WksName );{Checks if the worksheet exists by name} IF WksH = NIL THEN BEGIN Sysbeep; AlrtDialog ( 'The export worksheet does not exist in this document!' ); GOTO 99; END; SelectSS ( WksH ); DoMenuText ( 'WSRecalculate' ); DoMenuTextByName ( 'Export Worksheet' , 0 ); 99 : END;RUN ( WSexport ); Quote Link to comment
Dom Posted February 10, 2002 Author Share Posted February 10, 2002 I can no other answer make but THANKS! really appreciate it.. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.