ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Change of workbook procedure (https://www.excelbanter.com/excel-programming/316633-change-workbook-procedure.html)

magnus

Change of workbook procedure
 

Hi all excelgurus,

A question from a first timer on this forum. I’ve a VBA procedural
problem that I for the time being am unable to find a solution to.

Scenario:
Workbook(A_MASTER) with VBA-main macros and a number of Sheets with
linkings in them (only linkings between various Sheets within the
workbook) and formulas that links to a specific
Sheet containing a database of values for different periods. The
formula linkings needs to be con-verted to values since the database
sheet is not to be part of the final Workbook(C ) –see below.

When processing begins Workbook(A_MASTER) is saved as Workbook(B_temp)
to a different folder. The reason being that all linking formulas is to
be converted to values and I don’t want the Workbook(A_MASTER) to be
altered. Furthermore, copy is not an option since that gives me a new
workbook with linkings to another workbook. At this point the
Workbook(B_temp) is the only open workbook and contains the main macros
that continue to process. All linking formulas are now converted to
values and finally only some sheets are selected (through
Sheets(Array…) where after this selection is copied to a new blank
workbook and named Workbook(C). Two workbooks are now open, Workbook(C
) -being the active workbook- and Workbook(B_temp). The active workbook
is now closed.

Workbook(A_MASTER) is once again opened since I now want to close down
and kill Work-book(B_temp). Two workbooks is now open, Workbook(B_temp)
and Workbook(A_MASTER).
At this point I’m trying to call on procedures in Workbook(A_MASTER) in
order to first close
Workbook(B_temp) without saving and then Kill Workbook(B_temp). I’ve
tried to carefully qualify the path and filename to Workbook(A_MASTER)
and a specific procedure in Module1.
I’m able to close down Workbook(B_temp) but then the process stops
altogether and the only
workbook open is Workbook(A_MASTER. The last session, the call on a
procedure that actually kills the file Workbook(B_temp).xls, is not
carried out.

The indications, as far as I can tell, seems to be that, for some
reason, I’m still processing the macro within Workbook(B_temp) and when
this workbook is closed the processing stops.

I will be most grateful for some hint that can lead to a solution or a
workaround to this.


/magnus


--
magnus
------------------------------------------------------------------------
magnus's Profile: http://www.excelforum.com/member.php...o&userid=12829
View this thread: http://www.excelforum.com/showthread...hreadid=277812



All times are GMT +1. The time now is 07:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com