Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.setup
external usenet poster
 
Posts: 12
Default DEC2HEX with VBA in Excel 2007

I have a program working with Excel 2003 with VBA that uses the DEC2HEX
function within the VB routine (not in the Excel sheet)

I have turned the Analysis and the Analysis VBA add-in on.

I have also checked the atpvbaen.xls reference on in the VBA tools section.

The Dec2Hex (and Hex2Dec) routines return sub or function not found error.

The help section says it does exist.. However I am not able to use it. Any
ideas on what can be done ?

----------- routine enclosed -------------
Private Sub CommandButton_ChangeSlaveAddress_Click()
Dim SlaveAddress As Integer
SlaveAddress = Hex2Dec(Range("SlaveAddressInput").value)

If SlaveAddress < 0 Or SlaveAddress 255 Then
MsgBox ("Invalid slave address entered!")
Else
Range("SlaveAddressInput").value = Dec2Hex(SlaveAddress, 2)
End If

End Sub
--------------------------
Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.setup
external usenet poster
 
Posts: 35,218
Default DEC2HEX with VBA in Excel 2007

Your subject says xl2007, but your message says xl2003?

If you're using xl2003, then make sure you add a reference to the analysis
toolpak VBA in the VBE.

Open your workbook
Open the VBE
select your project
Tools|References|Check atpvbaen.xls

You need the addin (excel's Tools|addins) and the reference for this to work.

The addin for the "analysis toolpak" isn't required for this. You may need it
for other stuff in the worsheets, though.



Rishi wrote:

I have a program working with Excel 2003 with VBA that uses the DEC2HEX
function within the VB routine (not in the Excel sheet)

I have turned the Analysis and the Analysis VBA add-in on.

I have also checked the atpvbaen.xls reference on in the VBA tools section.

The Dec2Hex (and Hex2Dec) routines return sub or function not found error.

The help section says it does exist.. However I am not able to use it. Any
ideas on what can be done ?

----------- routine enclosed -------------
Private Sub CommandButton_ChangeSlaveAddress_Click()
Dim SlaveAddress As Integer
SlaveAddress = Hex2Dec(Range("SlaveAddressInput").value)

If SlaveAddress < 0 Or SlaveAddress 255 Then
MsgBox ("Invalid slave address entered!")
Else
Range("SlaveAddressInput").value = Dec2Hex(SlaveAddress, 2)
End If

End Sub
--------------------------
Thanks in advance


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.setup
external usenet poster
 
Posts: 12
Default DEC2HEX with VBA in Excel 2007

Dave

Thanks. Part of the post got deleted. As I mentioned in my post atpvbaen.xls
is on in VBA.

The part that got deleted it "The program works in 2003. But I dont get it
to work in 2007 ".. I took it off and forgot to reinsert it. My bad.

The Dec2Hex (and Hex2Dec) routines return sub or function not found error.

Any ideas ?
Thanks

"Dave Peterson" wrote:

Your subject says xl2007, but your message says xl2003?

If you're using xl2003, then make sure you add a reference to the analysis
toolpak VBA in the VBE.

Open your workbook
Open the VBE
select your project
Tools|References|Check atpvbaen.xls

You need the addin (excel's Tools|addins) and the reference for this to work.

The addin for the "analysis toolpak" isn't required for this. You may need it
for other stuff in the worsheets, though.



Rishi wrote:

I have a program working with Excel 2003 with VBA that uses the DEC2HEX
function within the VB routine (not in the Excel sheet)

I have turned the Analysis and the Analysis VBA add-in on.

I have also checked the atpvbaen.xls reference on in the VBA tools section.

The Dec2Hex (and Hex2Dec) routines return sub or function not found error.

The help section says it does exist.. However I am not able to use it. Any
ideas on what can be done ?

----------- routine enclosed -------------
Private Sub CommandButton_ChangeSlaveAddress_Click()
Dim SlaveAddress As Integer
SlaveAddress = Hex2Dec(Range("SlaveAddressInput").value)

If SlaveAddress < 0 Or SlaveAddress 255 Then
MsgBox ("Invalid slave address entered!")
Else
Range("SlaveAddressInput").value = Dec2Hex(SlaveAddress, 2)
End If

End Sub
--------------------------
Thanks in advance


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.setup
external usenet poster
 
Posts: 35,218
Default DEC2HEX with VBA in Excel 2007

xl2007 removed all those worksheet functions from the addin and moved them into
excel itself.

That means you don't need the reference within the VBE.

This worked ok for me in xl2007:

Option Explicit
Sub testme()
MsgBox Application.Dec2Hex(100)
MsgBox Application.Hex2Dec(64)
End Sub



Rishi wrote:

Dave

Thanks. Part of the post got deleted. As I mentioned in my post atpvbaen.xls
is on in VBA.

The part that got deleted it "The program works in 2003. But I dont get it
to work in 2007 ".. I took it off and forgot to reinsert it. My bad.

The Dec2Hex (and Hex2Dec) routines return sub or function not found error.

Any ideas ?
Thanks

"Dave Peterson" wrote:

Your subject says xl2007, but your message says xl2003?

If you're using xl2003, then make sure you add a reference to the analysis
toolpak VBA in the VBE.

Open your workbook
Open the VBE
select your project
Tools|References|Check atpvbaen.xls

You need the addin (excel's Tools|addins) and the reference for this to work.

The addin for the "analysis toolpak" isn't required for this. You may need it
for other stuff in the worsheets, though.



Rishi wrote:

I have a program working with Excel 2003 with VBA that uses the DEC2HEX
function within the VB routine (not in the Excel sheet)

I have turned the Analysis and the Analysis VBA add-in on.

I have also checked the atpvbaen.xls reference on in the VBA tools section.

The Dec2Hex (and Hex2Dec) routines return sub or function not found error.

The help section says it does exist.. However I am not able to use it. Any
ideas on what can be done ?

----------- routine enclosed -------------
Private Sub CommandButton_ChangeSlaveAddress_Click()
Dim SlaveAddress As Integer
SlaveAddress = Hex2Dec(Range("SlaveAddressInput").value)

If SlaveAddress < 0 Or SlaveAddress 255 Then
MsgBox ("Invalid slave address entered!")
Else
Range("SlaveAddressInput").value = Dec2Hex(SlaveAddress, 2)
End If

End Sub
--------------------------
Thanks in advance


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.setup
external usenet poster
 
Posts: 12
Default DEC2HEX with VBA in Excel 2007

Great. Adding the Application. to the Dec2Hex worked. I tried using the
Worksheetfunction.Dec2Hex earlier but that had not worked. I was thinking
they are the same thing..

Thanks much !

"Dave Peterson" wrote:

xl2007 removed all those worksheet functions from the addin and moved them into
excel itself.

That means you don't need the reference within the VBE.

This worked ok for me in xl2007:

Option Explicit
Sub testme()
MsgBox Application.Dec2Hex(100)
MsgBox Application.Hex2Dec(64)
End Sub



Rishi wrote:

Dave

Thanks. Part of the post got deleted. As I mentioned in my post atpvbaen.xls
is on in VBA.

The part that got deleted it "The program works in 2003. But I dont get it
to work in 2007 ".. I took it off and forgot to reinsert it. My bad.

The Dec2Hex (and Hex2Dec) routines return sub or function not found error.

Any ideas ?
Thanks

"Dave Peterson" wrote:

Your subject says xl2007, but your message says xl2003?

If you're using xl2003, then make sure you add a reference to the analysis
toolpak VBA in the VBE.

Open your workbook
Open the VBE
select your project
Tools|References|Check atpvbaen.xls

You need the addin (excel's Tools|addins) and the reference for this to work.

The addin for the "analysis toolpak" isn't required for this. You may need it
for other stuff in the worsheets, though.



Rishi wrote:

I have a program working with Excel 2003 with VBA that uses the DEC2HEX
function within the VB routine (not in the Excel sheet)

I have turned the Analysis and the Analysis VBA add-in on.

I have also checked the atpvbaen.xls reference on in the VBA tools section.

The Dec2Hex (and Hex2Dec) routines return sub or function not found error.

The help section says it does exist.. However I am not able to use it. Any
ideas on what can be done ?

----------- routine enclosed -------------
Private Sub CommandButton_ChangeSlaveAddress_Click()
Dim SlaveAddress As Integer
SlaveAddress = Hex2Dec(Range("SlaveAddressInput").value)

If SlaveAddress < 0 Or SlaveAddress 255 Then
MsgBox ("Invalid slave address entered!")
Else
Range("SlaveAddressInput").value = Dec2Hex(SlaveAddress, 2)
End If

End Sub
--------------------------
Thanks in advance

--

Dave Peterson


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.setup
external usenet poster
 
Posts: 35,218
Default DEC2HEX with VBA in Excel 2007

They're not quite the same thing, but this worked for me in xl2007:

Option Explicit
Sub testme()
MsgBox WorksheetFunction.Dec2Hex(100)
MsgBox WorksheetFunction.Hex2Dec(64)
End Sub

Maybe you did something else when you were testing????

Rishi wrote:

Great. Adding the Application. to the Dec2Hex worked. I tried using the
Worksheetfunction.Dec2Hex earlier but that had not worked. I was thinking
they are the same thing..

Thanks much !

"Dave Peterson" wrote:

xl2007 removed all those worksheet functions from the addin and moved them into
excel itself.

That means you don't need the reference within the VBE.

This worked ok for me in xl2007:

Option Explicit
Sub testme()
MsgBox Application.Dec2Hex(100)
MsgBox Application.Hex2Dec(64)
End Sub



Rishi wrote:

Dave

Thanks. Part of the post got deleted. As I mentioned in my post atpvbaen.xls
is on in VBA.

The part that got deleted it "The program works in 2003. But I dont get it
to work in 2007 ".. I took it off and forgot to reinsert it. My bad.

The Dec2Hex (and Hex2Dec) routines return sub or function not found error.

Any ideas ?
Thanks

"Dave Peterson" wrote:

Your subject says xl2007, but your message says xl2003?

If you're using xl2003, then make sure you add a reference to the analysis
toolpak VBA in the VBE.

Open your workbook
Open the VBE
select your project
Tools|References|Check atpvbaen.xls

You need the addin (excel's Tools|addins) and the reference for this to work.

The addin for the "analysis toolpak" isn't required for this. You may need it
for other stuff in the worsheets, though.



Rishi wrote:

I have a program working with Excel 2003 with VBA that uses the DEC2HEX
function within the VB routine (not in the Excel sheet)

I have turned the Analysis and the Analysis VBA add-in on.

I have also checked the atpvbaen.xls reference on in the VBA tools section.

The Dec2Hex (and Hex2Dec) routines return sub or function not found error.

The help section says it does exist.. However I am not able to use it. Any
ideas on what can be done ?

----------- routine enclosed -------------
Private Sub CommandButton_ChangeSlaveAddress_Click()
Dim SlaveAddress As Integer
SlaveAddress = Hex2Dec(Range("SlaveAddressInput").value)

If SlaveAddress < 0 Or SlaveAddress 255 Then
MsgBox ("Invalid slave address entered!")
Else
Range("SlaveAddressInput").value = Dec2Hex(SlaveAddress, 2)
End If

End Sub
--------------------------
Thanks in advance

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
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
Pasting a chart from Excel 2007 to Word 2007 trouble Vegas Charts and Charting in Excel 5 September 16th 08 07:37 AM
Paste EXCEL 2007 sheet into WORD 2007 - objects move around Martin L Excel Discussion (Misc queries) 5 February 29th 08 01:45 PM
Chart Selection - Excel 2007 copy to Powerpoint 2007 GS80 Charts and Charting in Excel 1 February 7th 08 01:30 PM
how to email excel 2007 worksheet with outlook 2007 djog6944 Excel Worksheet Functions 1 December 23rd 07 07:05 PM
Embedded Dec2hex help needed mogulboy Excel Worksheet Functions 2 August 2nd 07 05:52 PM


All times are GMT +1. The time now is 06:28 AM.

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"