Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Run procedure in Personal.xls which needs name of calling work

Calling the save with Application.Ontime, what would be the command format I
need (if it's possible) to use Application.Ontime to Call the save routine,
AND send the save routine the name of the workbook that it is to save under
the new name the save routine generates with a text string and the value of
the cell on worksheets(6) of the workbook the save routine is supposed to be
saving?

I got the external routines to work.. sort-of, but without using
Application.Ontime to force the rpocedure to wait 5 - 10 seconds before
calling the save routine causes the saved workbook to have all the actual VBA
coding removed, but it still has the empty forms and Modules names in it so
when the sheet is opened, Excel still thinks the sheet contains macros.
Looks like if I can delay the save for probably another 5 - 10 seconds, that
would probably be long enough to allow the empty modules to be removed before
the save routine actually saves the workbook

"Tom Ogilvy" wrote:

You wouldn't want to use the run method anyway if you will save and close
the workbook. You would want to use application.Ontime.

Just make your workbook to be saved (and closed) to be the activeworkbook
before you call your code using Ontime. You should have that code also
contain the code for removing code from the workbook to be saved.

If you try to save in the same code that does the clearing of the code. you
will find that the code is not cleared. Using Ontime breaks this code
chain and allow the code to be actually removed and the workbook saved
without the code

--
Regards,
Tom Ogilvy


"rcmodelr" wrote in message
...
I currently have a spreadsheet set up with coding to automatically

configure
the individual sheets based on which farms and how many loads at each farm
are scheduled.

After sheet is set up, coding is NO LONGER NEEDED, and currently saves the
workbook with a new name, then removes ALL the VBA coding from the

workbook.

I want to be able to have the VBA coding removed from the workbook THEN

have
the workbook save itself.

I tried it with the save procedure AFTER the code removal procedure, but
once the code is removed, the save procedure never executes (as expected)

So
I'm thinking I probably need the code remove/workbook save procedure in
another workbook. But THAT would mean I'd have to be able to call that
procedure FROM the workbook being worked on, and get that external

procedure
to know which workbook was previously active and had called the procedure.

I tried copying the save/code remove from the workbook to the

Personal.xls,
but now I need the way to tell the procedure which workbook it was called
from.

Help on the RUN method says the ONLY type of arguments that RUN will allow
to be sent to the external procedure are NUMERIC, and will NOT accept
variables or strings to be passed.

Is this ONE area where the Help system is wrong? If not, how can I tell

the
procedure in my Personal.xls the name of the active workbook that had

called
the procedure? When I execute the RUN method, the ActiveWorkbook changes

to
Personal.xls, which seems to mean I need some way to set the
ActiveWorkbook.Name to a variable, then have some way to send the contents

of
that variable TO the procedure in the Personal.xls workbook so it can know
which workbook it is supposed to be removing the code from and saving.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling sub procedure Yossi[_2_] Excel Programming 2 August 21st 05 02:01 PM
Calling a procedure in a procedure Norman Jones Excel Programming 8 August 20th 04 07:53 PM
Calling a procedure in a procedure N10 Excel Programming 2 August 18th 04 12:49 AM
Calling a procedure in a procedure Don Guillett[_4_] Excel Programming 1 August 17th 04 11:31 PM


All times are GMT +1. The time now is 05:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"