Jump to content

Automated Worksheet Export Procedure


Recommended Posts

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...


Link to comment

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 );

Link to comment

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.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...