• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

compile a procedure in 32 bits

Hello forum,

In a Win7 and Excel 2010 both 64-bits environment, I have to use in a VBA procedure a 32-bits dll. To do this, I need to compile the VBA code in 32 bits.

Could someone explain to me what this means and, more importantly, how to do that.

Thank you in advance for your answers.

Harry
 
Hi harry..


I assume you are facing problem in a Declare Function statements.. where Reference is missing..


Try to add a "PTRSAFE" keyword after Declare Statements.. May be it resolve the problem..


or can you please upload sample file with Code..


Regards,

Deb
 
Hi Debraj Roy,

Thanks for your quick answer.

I do not think whether it is a Declare problem.But you did not have all the elements.

This is the advice coming from the Skype development platform.

"Skype4COM may well be used in a 64 bit environment. Skype works itself into 32 bits. You have to compile your code for 32-bit platform".

The code is very simple (coming from the Skype development platform):

Sub sendsms()

Dim mSkype As New Skype

Dim cmd As New Command

cmd.Command = "CREATE SMS OUTGOING +123456789"

cmd.ID = 0

mSkype.SendCommand(cmd)

End sub

On the instruction "cmd.Command = "CREATE SMS OUTGOING +123456789"" I receive a message that "ActiveX can't create object".

Of course, Skype4com is well installed and referenced.

I hope this can help to understand the problem.


Regards


Harry
 
Can you please check this code with yours environment..


http://www.mrexcel.com/forum/excel-questions/424432-sending-skype-message-through-excel-visual-basic-applications.html#post2098335


Dont forget to add reference ..


Regards,

Deb
 
Hi Debraj Roy,

It's been a while since I'm working on the problem

So I glean information on the net.

It is so that the method suggested in your link is out-of-date


"Re: sms from Excel

Options

le ‎07-08-2011 00:24


..... it's not public knowledge that SendSms no longer works."


The only way to send a sms with skype is to use a command.

So, I found on http://dev.skype.com/desktop-api-reference#SENDING_SMS_MESSAGES

"Creating an SMS message

To create, compose and send an SMS message, use CREATE SMS, SET SMS and ALTER SMS commands."

That's what I try to do but, as explained in my first post, I have to compile the code in a 32 bit environment. And I don't know how to do that.

If further information are needed, please ask.

Regards

Harry
 
Hi Harry ,


Compiling code for a 32-bit or 64-bit environment is a matter of specifying the target platform when compiling ; specifying the platform as x86 will compile it into a 32-bit object file , while specifying it as ANY CPU will compile it into code which can run in either 32-bit or 64-bit environments. But if you are using 32-bit dlls ( as Skype4COM is ) , then you cannot use ANY CPU.


Check out this link :


http://stackoverflow.com/questions/516730/what-does-the-visual-studio-any-cpu-target-mean


But if you are writing code to run in a 64-bit environment , then you need to go by what Deb has mentioned. More information is here :


http://msdn.microsoft.com/en-us/library/office/ee691831(v=office.14).aspx


Narayan
 
The information you've received from the Skype development platform is misleading: they are confusing VBA and (presumably) VB.Net. "You have to compile your code for 32-bit platform" is for VB.Net (or C# etc).


It sounds like Skype4COM.dll is a 32-bit COM dll which means that you cannot load it from 64-bit Excel.
 
Hi Harry ,


Check this link too :


http://newtonexcelbach.wordpress.com/2013/03/28/installing-dlls-on-64-bit-windows/


There are more links in the comments section.


Narayan
 
Hello the forum,

I want to thank everyone who was involved in this thread; thanks to Colin Legg which identified the problem or better the lack of problem. I persisted with VBA whether the retrieved information was probably related to another language.

Many thanks to Debraj Roy and Narayan911 for their patience; they are really teachers in their explanations.

Thanks for all your advice, I learned a lot. I mostly learned that I should not insist on a solution that doesn't exist.

But losing a battle is not losing the war.

It seems it is possible to use WScript with skype4com and WScript may well be compiled in 32 bit.

http://dev.skype.com/desktop-api-reference # SENDING_SMS_MESSAGES

http://dev.skype.com/desktop-api-reference # MANAGING_SMS_MESSAGES

and the screen "command.vbs" of skype4com.chm file

It "only" remains to learn WScript and how to integrate it with a VBA module.

Again thank you all for your support

Harry
 
If there is something which can be done using WScript then perhaps you can still go ahead with VBA.


WScript and its methods are available if you reference:

Windows Script Host Object model.


By the way the code posted did not work for me. I have 32 bit xp environment and have Excel 2010 and Skype [6.1.0.129] installed. Is there something which needs to be done apart from referencing Libraries?

Edit: I will need credit on Skype to send SMS. I don't have that so that is why it doesn't work.


Maybe this is useful for you instead of using cmd but it is untested:

nSkype.SendSms "123456789", "Hi"
 
Hi Shrivallabha,

Some credit is indeed required to send a sms with skype.

See my post above as response to Debraj Roy: sendsms is no more supported by skype4com. The only solution seems to be a command instruction. (http://dev.skype.com/desktop-api-reference#SENDING_SMS_MESSAGES)

Regards


Harry
 
Back
Top