Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Addin active sheet problem

I wrote a search form which works well as an Excel file, however, when
I converted it to an addin it throws up this error...

Object variable or with block variable not set

When I click on debug is highlights this part of the code

Set shtSearch = ThisWorkbook.ActiveSheet
Locate TextBox1.Text, shtSearch.Range("A:IV"), blnGotColor,
lngColor

I researched as much as I could on Newsgroups and see that an addin
does not have active sheets but I could not find out how to fix the
problem. Can someone help please?

Many thanks
Tony

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Addin active sheet problem

Are you actually wanting to search the addin workbook or another workbook.
It seems to me that ThisWorkbook should probably be replaced with
ActiveWorkbook,

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

wrote in message
oups.com...
I wrote a search form which works well as an Excel file, however, when
I converted it to an addin it throws up this error...

Object variable or with block variable not set

When I click on debug is highlights this part of the code

Set shtSearch = ThisWorkbook.ActiveSheet
Locate TextBox1.Text, shtSearch.Range("A:IV"), blnGotColor,
lngColor

I researched as much as I could on Newsgroups and see that an addin
does not have active sheets but I could not find out how to fix the
problem. Can someone help please?

Many thanks
Tony



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Addin active sheet problem

Good man Bob - worked a treat!

Cheers
Tony

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
XLA - Addin Active Don Excel Discussion (Misc queries) 1 September 5th 08 07:34 PM
Excel addin problem markww Excel Programming 1 November 15th 04 01:35 PM
Select all pivot table areas/ranges on the active sheet problem DataFreakFromUtah Excel Programming 3 October 27th 04 04:57 PM
addin problem: sheet mismatch by function parameters berrie Excel Programming 0 December 12th 03 11:21 AM
Addin problem boopesh Excel Programming 1 December 11th 03 12:56 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"