VBA DLL Example

You are not quite sure where to place your question or issue? You want to suggest a new forum or want to provide feedback to the board itself?

Try here!
Post Reply
laia
Posts: 8
Joined: Tue 16. Jun 2009, 20:05

VBA DLL Example

Post by laia » Tue 16. Jun 2009, 20:16

Hi,
I have a problem when I try to execute this VBA DLL Example. I can not read any code in VBA editor of Excel and the program doesn't work. I have already copy the MemBrainDll.dll" into the folder "C:\Windows\System32".
Thank you in advance for your attention.

Laia

User avatar
Admin
Site Admin
Posts: 438
Joined: Sun 16. Nov 2008, 18:21

Re: VBA DLL Example

Post by Admin » Tue 16. Jun 2009, 21:38

Hi Laia,

I've already heard about that problem and there's also a corresponding thread in the German section of the Board.

It seams to be related to Excel versions > 2003 (the VBA example has been created using Excel 2000). What version of MS Office/Excel are you using?
I'll further investigate into this. Hopefully I will be able to dig down to the root cause of the problem and provide hints to work around.
Alternatively I'll try to get access to an Excel version > 2003 and re-create the example.

I'll let you know as soon as I have further insight...

Regards,
Thomas
Thomas Jetter

User avatar
Admin
Site Admin
Posts: 438
Joined: Sun 16. Nov 2008, 18:21

Re: VBA DLL Example

Post by Admin » Tue 16. Jun 2009, 21:55

Hi Laia,

I've tried to translate the solution somebody found for this problem in the German section of the board. It seems to be necessary to add the path to the Excel file to your 'trusted locations' like described here:

http://office.microsoft.com/en-us/excel ... 91033.aspx

Please let me know if this worked.

Original German thread:
viewtopic.php?f=6&t=6

Thanks and regards

laia
Posts: 8
Joined: Tue 16. Jun 2009, 20:05

Re: VBA DLL Example

Post by laia » Tue 23. Jun 2009, 23:23

Hi Thomas,

I tried to add the excel path in this 'trusted locations ' but unfortunately it still doesn't work! I am working with Excel 2007.
Thank you and best regards,

Laia

User avatar
Admin
Site Admin
Posts: 438
Joined: Sun 16. Nov 2008, 18:21

Re: VBA DLL Example

Post by Admin » Wed 24. Jun 2009, 21:51

OK, thanks for the feedback. Seems that I have to get a hold of an Excel 2007 version somehow.

I'll let you know once I have found out what the problem is.
but unfortunately it still doesn't work!
Does that mean that you still see no code at all? Or has the behaviour at least changed?
Thomas Jetter

laia
Posts: 8
Joined: Tue 16. Jun 2009, 20:05

Re: VBA DLL Example

Post by laia » Thu 25. Jun 2009, 11:14

Hi Thomas,
that means that I see no code at all in Visual Basic.
Best regards,

Laia

laia
Posts: 8
Joined: Tue 16. Jun 2009, 20:05

Re: VBA DLL Example

Post by laia » Wed 29. Jul 2009, 15:31

Hi Thomas,

I have written a Script to create, train and validate some nets.Then I have done also another script in visual basic to analyze the dates that MemBrain gives (these .csv files). Now my idea is to combine these two scripts in order to have just one program, which create, train, validate the nets and analyze all the dates. Is it possible to execute the membrain script in Visual basic? I've already told you that I can not see this VB example at all. It would be nice if you could help me.
Thank you in advance.

Best regards,

Laia

User avatar
Admin
Site Admin
Posts: 438
Joined: Sun 16. Nov 2008, 18:21

Re: VBA DLL Example

Post by Admin » Wed 29. Jul 2009, 16:03

Hi Laia,

no, the dll has no scripting functionality, i.e., you can not run MemBrain scripts from within Excel. However, you may be able to do it the other way round: MemBrain scripting does allow you to start external applications. Thus, you could try to launch Excel from within the MemBrain script after the data generation is finished. I don't know what the parameters to Excel must be to cause it to automatically start a VBA program but I assume that this should be possible.

Does this help? If you manage to do so it would be great if you quickly could post the approach here!

Regards,
Thomas
Thomas Jetter

laia
Posts: 8
Joined: Tue 16. Jun 2009, 20:05

Re: VBA DLL Example

Post by laia » Wed 29. Jul 2009, 18:11

Hi Thomas,

your idea was great. I used the function ShellExecute( "open" , "path of the excel file that contains the macro ", "") and then I save all the VB program as a macro. This macro is saved as Auto_Open(), that means that the macro is executed automatically as soon as Excel is opened. In this way I could combine both scripts.

When I finish all the program, I am going to upload in the forum.
Thank you very much!!!


Laia

User avatar
Admin
Site Admin
Posts: 438
Joined: Sun 16. Nov 2008, 18:21

Re: VBA DLL Example

Post by Admin » Wed 29. Jul 2009, 18:13

Thanks for the rapid feedback, great to hear that this works with Excel!

Cheers
Thomas Jetter

Post Reply