LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Microsoft Visual Basic for Applications Extensibility 5.3 Issue

If you are using Late binding, which it seems you are, the reference and the
Extensibility version is not relevant.

If Trust Access to VBProjects is not allowed the code will fail.
There could be all sorts of other reasons it'll fail with names etc not as
expected


If all you are trying to do is set a reference to a sheet with known
codename, at least it looks like that's what you are after

For Each ws In ActiveWorkbook.Worksheets
If ws.CodeName = myWSCodename Then
Exit For
End If
Next

If Not ws Is Nothing Then
MsgBox ws.Name, , myWSCodename
Else
MsgBox "not found"
End If

I know this is a loop but unless you have hundreds of sheets it's unlikely
you'll notice any difference, if anything with a typical qty of sheets the
loop will probably be quicker. The main advantage though is the Trust Access
option is not required.

Regards,
Peter T


"Barb Reinhardt" wrote in message
...
I am using the following bit of code

On Error Resume Next
Set FindWorksheet =
myXLBook.Worksheets(CStr(myXLBook.VBProject.VBComp onents(myWSCodename).Properties("Name")))
On Error GoTo 0

to find a worksheet. FindWorksheet is defined as a Worksheet. This code
works on my computer when the Microsoft Visual Basic for Application
Extensibility 5.3 reference is unchecked. FWIW, I'm using Excel 2003 on
Windows XP.

A colleague is running the same code in her machine with the reference
unchecked and it's not finding anything. She's also using Office 2003 and
I
suspect she's using Windows XP, but I'm not certain. When we select the
reference to the Extensibility library on her machine, everything works
fine.


Gary's Student has helped some in this thread

http://www.microsoft.com/office/comm...9-5eec3868474a

, but I still don't understand why it works on some machines and not on
others. I really don't want to have to redistribute this application
again.

Can someone assist?

Thanks,
Barb Reinhardt



 
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
problems with excel and visual basic for applications Edward Letendre Excel Discussion (Misc queries) 0 September 24th 09 11:03 PM
Visual Basic Applications - Help Files JMay-Rke Excel Programming 1 July 4th 08 05:19 PM
Microsoft Visual Basic for Applications Extensibilty 5.3 jason Excel Programming 2 August 12th 04 08:51 AM
Visual Basic for Applications Alex Park Excel Programming 4 June 10th 04 11:08 AM
Visual Basic For Applications Rob[_14_] Excel Programming 3 January 10th 04 05:22 PM


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