Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Ghost VBA Projects Created when using Hypelink

Hello,

I'm am having a difficult time with the following task.

I have 2 excel workbooks.

Book 1 has a hyperlink to open Book 2

Book 2 has the Workbook_Open macro below to force the file into Read-
Only mode.

The issue I'm having is whenever I launch Book 2 from the standard
hyperlink, I am getting multiple ghost projects of Book 2 opening up.
It will then screw up my entire Excel session from that point forward.

Any suggestions?

Thanks in advance.




Sub Workbook_open()

Application.ScreenUpdating = False

Dim strName, strPath, strCurrName As String

strName = ActiveWorkbook.Name
strPath = ActiveWorkbook.Path
strCurrName = strPath & "\" & strName

Workbooks.Open strCurrName, ReadOnly:=True

Application.ScreenUpdating = True

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Ghost VBA Projects Created when using Hypelink

Why would you want a workbook when it opens, open a workbook that is already
opened?

This macro makes no sense!!!

"slim26" wrote:

Hello,

I'm am having a difficult time with the following task.

I have 2 excel workbooks.

Book 1 has a hyperlink to open Book 2

Book 2 has the Workbook_Open macro below to force the file into Read-
Only mode.

The issue I'm having is whenever I launch Book 2 from the standard
hyperlink, I am getting multiple ghost projects of Book 2 opening up.
It will then screw up my entire Excel session from that point forward.

Any suggestions?

Thanks in advance.




Sub Workbook_open()

Application.ScreenUpdating = False

Dim strName, strPath, strCurrName As String

strName = ActiveWorkbook.Name
strPath = ActiveWorkbook.Path
strCurrName = strPath & "\" & strName

Workbooks.Open strCurrName, ReadOnly:=True

Application.ScreenUpdating = True

End Sub
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Ghost VBA Projects Created when using Hypelink

On Nov 18, 6:09*am, Joel wrote:
Why would you want a workbook when it opens, open a workbook that is already
opened?

This macro makes no sense!!!

"slim26" wrote:
Hello,


I'm am having a difficult time with the following task.


I have 2 excel workbooks.


Book 1 has a hyperlink to open Book 2


Book 2 has the Workbook_Open macro below to force the file into Read-
Only mode.


The issue I'm having is whenever I launch Book 2 from the standard
hyperlink, I am getting multiple ghost projects of Book 2 opening up.
It will then screw up my entire Excel session from that point forward.


Any suggestions?


Thanks in advance.


Sub Workbook_open()


Application.ScreenUpdating = False


Dim strName, strPath, strCurrName As String


strName = ActiveWorkbook.Name
strPath = ActiveWorkbook.Path
strCurrName = strPath & "\" & strName


Workbooks.Open strCurrName, ReadOnly:=True


Application.ScreenUpdating = True


End Sub
.


Purpose of the macro is to force the file into readonly mode upon
opening. But I believe I see the error now. Thanks.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Ghost VBA Projects Created when using Hypelink

On Nov 18, 9:08*am, slim26 wrote:
On Nov 18, 6:09*am, Joel wrote:



Why would you want a workbook when it opens, open a workbook that is already
opened?


This macro makes no sense!!!


"slim26" wrote:
Hello,


I'm am having a difficult time with the following task.


I have 2 excel workbooks.


Book 1 has a hyperlink to open Book 2


Book 2 has the Workbook_Open macro below to force the file into Read-
Only mode.


The issue I'm having is whenever I launch Book 2 from the standard
hyperlink, I am getting multiple ghost projects of Book 2 opening up.
It will then screw up my entire Excel session from that point forward..


Any suggestions?


Thanks in advance.


Sub Workbook_open()


Application.ScreenUpdating = False


Dim strName, strPath, strCurrName As String


strName = ActiveWorkbook.Name
strPath = ActiveWorkbook.Path
strCurrName = strPath & "\" & strName


Workbooks.Open strCurrName, ReadOnly:=True


Application.ScreenUpdating = True


End Sub
.


Purpose of the macro is to force the file into readonly mode upon
opening. *But I believe I see the error now. *Thanks.


I was using the wrong method to attempt to force file to open as
readonly.

All I simply needed was this:

Private Sub Workbook_open()
ThisWorkbook.ChangeFileAccess Mode:=xlReadOnly
End Sub




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
Ghost in my VLOOKUP WildWill Excel Discussion (Misc queries) 1 October 12th 09 04:28 PM
Hypelink and Paste L. Mo Excel Worksheet Functions 0 September 12th 06 11:14 PM
I seem to have a ghost macro. SongCoyote Excel Discussion (Misc queries) 1 September 13th 05 01:04 AM
PIVOT TABLE + HYPELINK: Mission Impossible ? hkappleorange Links and Linking in Excel 1 August 31st 05 03:36 AM
How to become a better programmer, post college. More projects or less projects. Matt Somers Excel Programming 1 February 12th 04 01:54 PM


All times are GMT +1. The time now is 06:26 AM.

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"