Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Storing workbook name


Hey guys how do I store the name of a workbook in a variable so that I
can activate it late on in the procedure?

The user will save the file according to what he wants and hence I need
to use a variable to activate the workbook.

thanks for your time
jnasr


--
jnasr00
------------------------------------------------------------------------
jnasr00's Profile: http://www.excelforum.com/member.php...o&userid=28515
View this thread: http://www.excelforum.com/showthread...hreadid=502347

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 301
Default Storing workbook name

MyVariable = Activeworkbook.Name
Bob Umlas
Excel MVP

"jnasr00" wrote in
message ...

Hey guys how do I store the name of a workbook in a variable so that I
can activate it late on in the procedure?

The user will save the file according to what he wants and hence I need
to use a variable to activate the workbook.

thanks for your time
jnasr


--
jnasr00
------------------------------------------------------------------------
jnasr00's Profile:
http://www.excelforum.com/member.php...o&userid=28515
View this thread: http://www.excelforum.com/showthread...hreadid=502347



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Storing workbook name

Rather than just store the workbook name, store the workbook object

DIm oWB As Workbook

Set oWB = ActiveWorkbook

or maybe when you open the workbook

Set oWB = Workbooks.Open(filename)

Then you can re-activate later with

oWB.ACtivate

or just reference that object direcly

With oWB
...
End With

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"jnasr00" wrote in
message ...

Hey guys how do I store the name of a workbook in a variable so that I
can activate it late on in the procedure?

The user will save the file according to what he wants and hence I need
to use a variable to activate the workbook.

thanks for your time
jnasr


--
jnasr00
------------------------------------------------------------------------
jnasr00's Profile:

http://www.excelforum.com/member.php...o&userid=28515
View this thread: http://www.excelforum.com/showthread...hreadid=502347



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
Storing all macros in one workbook MissyLovesExcel Excel Programming 4 December 2nd 08 01:28 PM
storing data JK57 Excel Worksheet Functions 3 May 1st 06 12:16 AM
Storing data Bob Mckenzie New Users to Excel 3 July 30th 05 07:33 PM
Storing generic objects in workbook via automation Nacho Nachev Excel Programming 0 September 16th 04 03:55 PM
Storing appostrophe's in SQL Jeff Excel Programming 4 August 6th 04 01:05 PM


All times are GMT +1. The time now is 02:19 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"