Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2008

Tip: Looking for answers? Try searching our database.

store active workbook

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
greg - 27 May 2008 19:06 GMT
OK,
This must be something simple.  That I just don't see.
If I want to store the active workbook in a property.
I am trying the following code.  However I am getting an error on setting
the activeworkbook.

Anyone have any ideas?
thanks

Private m_objWorkspaceWorkbook As New Excel.Workbook

Public Property Set WorkspaceWorkbook(ByVal vData As Excel.Workbook)
   Set m_objWorkspaceWorkbook = vData
End Property

Public Property Get WorkspaceWorkbook() As Excel.Workbook
   Set WorkspaceWorkbook = m_objWorkspaceWorkbook
End Property

Sub xxx()
Dim objWB As Excel.Workbook
Set objWB = Excel.ActiveWorkbook
WorkspaceWorkbook objWB '??????????
End Sub
JNW - 27 May 2008 23:46 GMT
I generally store the name then use that to recall the workbook later.

aWB = activeworkbook.name

workspaceworkbook = workbooks(aWB)

> OK,
> This must be something simple.  That I just don't see.
[quoted text clipped - 20 lines]
> WorkspaceWorkbook objWB '??????????
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.