0

I kind of renamed the personal macro workbook and copied it to the server for my teammates to access. When you manually open the macro workbook it only opens in VBA without showing an actual workbook, but when I try to do it with VBA, a physical workbook opens up.

Dim MyFolder As String
MyFolder = "file:///\\FPSFILES1\ReviewPricing\Macro Data\RP Macro Wrkbk.xlsb"
ActiveWorkbook.FollowHyperlink MyFolder

How can I get the workbook to open in VBA only so users don't see a physical book that they can close (which closes it in VBA too)?

Robert Todar
  • 2,085
  • 2
  • 11
  • 31
Shevy
  • 57
  • 2
  • 10
  • Possible duplicate of [Open Excel file for reading with VBA without display](https://stackoverflow.com/questions/579797/open-excel-file-for-reading-with-vba-without-display) – BigBen Jun 19 '19 at 02:10
  • `Application.ScreenUpdating = False` might be an option too. Not sure what your actual use case is. – BigBen Jun 19 '19 at 02:16
  • I have a few mini programs that analyses various sets of data in excel. These are all stored in this macro workbook. I want to give my team a button on the quick access toolbar which will enable the custom tab I created (with buttons for each mini program) to run. – Shevy Jun 19 '19 at 02:32
  • `Application.ScreenUpdating = False` doesnt help because there is still a physical workbook that can be closed which will cut off access to all macros in there. – Shevy Jun 19 '19 at 02:35
  • It almost sounds like you want to create an add-in... – BigBen Jun 19 '19 at 02:37
  • You can Hide the Workbook, after it opens, That's the case with Personal Macro WorkBook as well. Goto - View And then Select Hide. – Mikku Jun 19 '19 at 02:43
  • hmm... I recorded the action and got `ActiveWindow.Visible = False`... that should do the trick – Shevy Jun 19 '19 at 02:50

1 Answers1

1

You can use ActiveWindow.Visible = False

Chronocidal
  • 6,827
  • 1
  • 12
  • 26
Shevy
  • 57
  • 2
  • 10