Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Security, Trust access to VB Projects ?
If that's the problem an alternative - sName = "Sheet2" ' ie codename For Each ws In ActiveWorkbook.Worksheets If ws.CodeName = sName Then sExcelName = ws.Name Exit For End If Next If Not ws Is Nothing Then MsgBox ws.Name, , sExcelName Else ' ?? End If Perhaps don't need to get sExcelName at all. Regards, Peter T "Barb Reinhardt" wrote in message ... Bob, I sent this workbook/presentation combination to someone to test drive and it didn't resolve this line sExcelName = XLBook.VBProject.VBComponents(sName).Properties("N ame") Any idea why? Barb "Bob Phillips" wrote: Barb, Try this sExcelName = xlBook.VBProject.VBComponents(sName).Properties("N ame") Set xlSheet = xlBook.Worksheets(sExcelName) -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Barb Reinhardt" wrote in message ... I'm doing some copying and pasting into a PowerPoint presentation and have a problem with the following: Set XLSheet = XLBook.Sheets(sName) and I get an error on only one value of sName. I have sName dimensioned as a string. What I want sName to be is the sheet code name, but I think it's behaving like the actual sheet name. What do I need to change in this code so that it sees sName as the code name and not the sheetname? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to prevent code running when in a worksheet code | Excel Programming | |||
Code Conflicts With Worksheet Change Code | Excel Programming | |||
Create a newworksheet with VBA code and put VBA code in the new worksheet module | Excel Programming | |||
Altering code to reference the worksheet before the active worksheet | Excel Programming | |||
Return to previous worksheet after code pastes in another worksheet? | Excel Programming |