Microsoft Office Packaging Wizard

  Chris the Ancient 21:33 21 Oct 2003

Not the most dynamic topic for the forum!

I'm in brain picking mode if anyone out there has ever used this facility.

I have Office XP Developer Pro and have virtually finished designing an Excel spreadsheet package that uses two distinctly different workbooks. But both are needed.

The 'main' workbook uses Excel VBA macros to do things to the 'supplementary' workbook. So of course, there are quite interesting path names in the 'main' workbook macros.

Of course, if I just moved the workbooks into some gash old folder, the macros would lose the path and things would go pear-shaped.

So, and now the $64,000 question to see if I'm going to do this right...

Does the Packaging Wizard work out and adjust these path names in the macros - or do I have to pre-define them and make sure that I set the destination path 110% correct?

Now there's a thought!


  VoG II 17:12 22 Oct 2003

I've written applications where one workbook has to open another - in this case the Main file opens an .XLA file that only contains VBA, UserForms and some hidden sheet. I made the assumption that if the user moved one file, they would move the other as well. So with both files assumed to be in the same folder, the following goes in the Main file:

Sub Auto_Open()

Dim path As String

path = ThisWorkbook.path ' WaQCoMvb.XLA should be in this directory

Workbooks.Open (path & "\WaQCoMvb.XLA")

Workbooks("WaQCoMvb.XLA").RunAutoMacros xlAutoOpen

End Sub

  Chris the Ancient 17:23 22 Oct 2003

Thanks for coming back. It was such an obscure question that I wasn't surprised that it 'fell off the bottom'. So, thanks for coming back on it!

Similar vein to mine VoG. But, I've found that if I try and abbreviate the path name length in the macro name that things get 'lost' - even if they are in the same folder.

Still, nothing daunted, I'll try again later when I've finished work (late this evening) and see if I can make it work this time. If I could do this, it would help a heck of a lot!

Catch ya later


  Chris the Ancient 20:55 22 Oct 2003

Praise and blessings upon your head, Sir!

Your system works in a most bountiful manner.

You have introduced me to a command I hadn't seen...

Dim path As String

path = ThisWorkbook.path ' WaQCoMvb.XLA should be in this directory

Workbooks.Open (path & "\WaQCoMvb.XLA")

And it worked with two .xls files.
ThisWorkbook.path is so useful, I shall have to remember it (it will go into my code librarian straight away.

You have saved the sanity etc. of another old - but slightly less revered one! MegaThanks.


This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Samsung Galaxy S9 review

Wacom Cintiq Pro 24 and 32 review – hands-on

Best Mac video editors

Idées cadeaux pour geeks et tech addicts