LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 112
Default Problem with references/variables

Hello,
Im creating references/variables to other worksheets in other workbooks
but they dont work when returning to the original workbook sheet.
Run time error 91: Object variable or With block variable not set
The two workbooks are loaded at one time and in the first/main
(WTNSystem.xls)
there is a module containing:
Public WSS As Worksheet, WSC As Worksheet, WSD As Worksheet, WSO As Worksheet
Public Sub Auto_Open()
ChDir ("D:\My Documents\Excel\Calc")
Workbooks.Open Filename:="WTNDatabase.xls"
Set WSS = Workbooks("WTNSystem").Worksheets("System")
Set WSC = Workbooks("WTNSystem").Worksheets("Calculation")
Set WSD = Workbooks("WTNDatabase").Worksheets("Database")
Set WSO = Workbooks("WTNDatabase").Worksheets("Offers")
WSS.Activate
End Sub

The second workbook is opened and everything works fine as long as I stay
within the main workbook and I can switch to the WTNDatabase.xls workbook
but returning to WTNsystem.xls with the code: WSC.Activate triggers the error.

I even put the same code as above in the WTNDatabase.xls , but it doesnt
help!!!
I cannot switch back to WTNSystem.xls with this abbreviation.

Why?


 
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
Variables in links and external file references Nate Links and Linking in Excel 1 October 12th 05 12:54 PM
Webqueries and variables problem dazman Excel Programming 3 August 4th 05 08:41 PM
Can I use variables for workheet name references in Excel functions? Amihai Bareket Excel Discussion (Misc queries) 1 February 4th 05 05:11 PM
Can I use variables for workheet name references in Excel functions? Amihai Bareket Excel Worksheet Functions 1 February 4th 05 05:11 PM
another look-up problem(three variables) mikey6704 Excel Programming 2 August 6th 04 09:06 PM


All times are GMT +1. The time now is 07:19 PM.

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"