Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Set XLSheet = XLBook.Sheets(sName) .codename
Barb Reinhardt wrote: 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That's not working either. Any other suggestions?
" wrote: Set XLSheet = XLBook.Sheets(sName) .codename Barb Reinhardt wrote: 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
MsgBox Sheets(Sheet1.Name).Range("a1")
-- Don Guillett SalesAid Software "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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm not clear on how this will help me. I'm not using Sheet1.name. I want
sname to be the what you show as Sheet1.name. "Don Guillett" wrote: MsgBox Sheets(Sheet1.Name).Range("a1") -- Don Guillett SalesAid Software "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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How would I dimension sExcelName?
"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 |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
s for String <g
-- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Barb Reinhardt" wrote in message ... How would I dimension sExcelName? "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 |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Got it to work. Thanks so much!
"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 |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Barb,
can you send it to me? -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "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 |
#12
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If I could I would. It's got proprietary info in it. Any other suggestions?
"Bob Phillips" wrote: Barb, can you send it to me? -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "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 |
#13
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can you not take out the confidential stuff?
-- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Barb Reinhardt" wrote in message ... If I could I would. It's got proprietary info in it. Any other suggestions? "Bob Phillips" wrote: Barb, can you send it to me? -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "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 |
#14
![]()
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 |