ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Worksheet Code Name question (https://www.excelbanter.com/excel-programming/375838-worksheet-code-name-question.html)

Barb Reinhardt

Worksheet Code Name question
 
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




[email protected]

Worksheet Code Name question
 
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



Don Guillett

Worksheet Code Name question
 
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






Barb Reinhardt

Worksheet Code Name question
 
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




Barb Reinhardt

Worksheet Code Name question
 
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







Bob Phillips

Worksheet Code Name question
 
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






Barb Reinhardt

Worksheet Code Name question
 
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







Barb Reinhardt

Worksheet Code Name question
 
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







Bob Phillips

Worksheet Code Name question
 
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









Barb Reinhardt

Worksheet Code Name question
 
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







Bob Phillips

Worksheet Code Name question
 
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









Barb Reinhardt

Worksheet Code Name question
 
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










Bob Phillips

Worksheet Code Name question
 
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












Barb Reinhardt

Worksheet Code Name question
 
A colleague has come up with another way to do this. Maybe he'll post it
here.

"Bob Phillips" wrote:

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













Peter T

Worksheet Code Name question
 
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










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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com