I would like to start PCAN-Explorer 5 from another application (i.e. Visual Basic, Visual C#...). What are the dll modules should be included in my application ? The following sample code in the help file does not work
Dim app As Application
Set app = CreateObject("PCANExplorer5.Application")
app.MainWindow.IsVisible = True
Thanks.
Start PCAN-Explorer from another application
Re: Start PCAN-Explorer from another application
To start PCAN-Explorer 5 from Visual Basic, you must add the reference to the PCAN-Explorer type library to your project. E.g. in VBA choose Extras->References and set a check mark on "PCAN-Explorer 5 Shared Objects". Then you can use this code to run PCAN-Explorer:
In C# it is similar: Project->Add Reference, and choose "PCAN-Explorer 5 Shared Objects" on the "COM" tab. To run PCAN-Explorer, use this code:
Code: Select all
Dim app As PCANExplorer5.Application
Set app = CreateObject("PCANExplorer5.Application")
app.MainWindow.IsVisible = True
Code: Select all
PCANExplorer5.Application app = new PCANExplorer5.Application();
app.MainWindow.IsVisible = true;
Start PCAN-Explorer from another application
Thanks for the solution.
Even after adding the references, which doesn't seem to be mentioned in the Help File, it still doesn't work in VBA at least. Maybe the reason is because there is a subtle difference between the code snippets in the Help File and the posted solution, but I'm not 100% sure.
Help File Code:
Dim app As Application
Forum Post Code:
Dim app As PCANExplorer5.Application
In summary, I am requesting that Help File article "Automating Tasks from other Applications" is updated as follows:
- Please mention which references to add.
- Please check and/or correct the code for app declaration.
Thanks.
Even after adding the references, which doesn't seem to be mentioned in the Help File, it still doesn't work in VBA at least. Maybe the reason is because there is a subtle difference between the code snippets in the Help File and the posted solution, but I'm not 100% sure.
Help File Code:
Dim app As Application
Forum Post Code:
Dim app As PCANExplorer5.Application
In summary, I am requesting that Help File article "Automating Tasks from other Applications" is updated as follows:
- Please mention which references to add.
- Please check and/or correct the code for app declaration.
Thanks.
Re: Start PCAN-Explorer from another application
OK, we have corrected the example code and mentioned which reference to add.
The updated help file is available with the next release v5.3.5.
The updated help file is available with the next release v5.3.5.