Welcome to the fracta.net forum!

Share your coding ideas or ask questions.

Question Avaya CMS VBA Wallboard Automation Issue

More
5 years 4 months ago #678 by novemberoyce
Hello,

I used the code found: fracta.net/fracta/index.php/forum/2-exce...s-supervisor-reports

Im using Avaya CMS Sup r18 and I have been trying to figure out the following for days now so I would like to ask some help


I am using a procedure where the .txt export is done while logged on to CMS

1. If Im exporting 3 reports, is it ok to have a separate sub for each or it's better to have them in one? If so, how do I have all 3 reports in one Sub

2. How do I set the property so it only exports as .txt and not show the CMS properties window nor the table(s) itself? I had the .window properties in the script set to the smallest and screen edge but I dont like the flicker it does everytime I do my loop.

The code I am creating is for an automated/looping procedure(s) for our wallboard so if I can just have it extract the file, that will be great!

3. How do I create a 'stop' procedure? I have the 3 subs to export different reports and one starts after the other finishes. After all 3 reports are exported, I have a loop procedure to start it all again. The stop procedure I have doesnt seem to stop all the subs :(

In desperate need of your help...

Thank you,
Holly

Please Log in or Create an account to join the conversation.

More
5 years 4 months ago - 7 months 1 week ago #679 by roller
Hi and welcome Holly. Firstly if you are using the running instance of the server, that of the Avaya application then the Interactive property of the connection/server (I can't remember which without checking it now) is set to true by default. True for Interactive means it will be visible for the user. This property can not be set to false programmatically, the only way to have it set to false is by creating your own connection object. No way around it I tired! What I have done in the past is set the location to outside the screen or PC monitor that was my best workaround.

You can have all your code in one sub and loop around the part of the code after creating the main object. Just clean the other objects on each cycle by setting them to Nothing. Be careful not to set to Nothing the Server or Connection objects or you kill your loop. If you want a pre-written file that loops around and generate different reports I have done one but there is a fee(donation) unfortunately if you can afford it. If you can't afford it I think I have written some example in the forum - here's the link to the file if you like to download it Avaya CMS automation Excel VBA macro - $3.50 : Zen Cart!, The Art of E-commerce (fracta.net)


Sorry it's early morning in Australia and I have to take the kids to school. Let me know if that helps or leave your questions and I will try to answer them when I get a chance.


Good luck
Last edit: 7 months 1 week ago by roller.
The following user(s) said Thank You: novemberoyce

Please Log in or Create an account to join the conversation.

More
5 years 4 months ago #680 by novemberoyce
I managed to create one Sub and declare variables for the reports I want to export.

a few things
1. Is there a code that:
  • Automatically open the report/table window based on set parameters?
  • If I have 3 different report window, how do i call each one to do copy and paste instead of .txt export?
Is it possible to run the copy table / export on the existing/running Report window?

2. Stopping the data export loop. If i have the export procedure in loop how do I do the 'stop' / 'exit sub' procedure

Im getting an OLE error even though Im exporting data using Set cvsSrv = cvsApp.Servers(1)

Appreciate your help roller!

Please Log in or Create an account to join the conversation.

More
5 years 4 months ago #681 by roller
Holly you are asking to many questions in the one post, it will take me a hour to properly answer each of them thoroughly. Please try to limit your questions to one issue per post so that others reading your comments can follow a particular issue.

Now I don't understand the first question. Copy and paste there are many examples on this forum please do your research before asking the same questions that have been answered. You can copy from an existing report and to do that you must find and hook into the running server then reference the correct report object to your VBA code - this is a bit involved and require advanced knowledge.

To Stop a running loop try using a Boolean that you can set to false such as a drop down list of RUN/STOP in a cell on the Excel sheet. In your VBA code use Do Events (look it up) this will allow the code to read the cell and lets you change it rather than freezing the Workbook while the code is running. So when you change the cell to STOP in your code you have something like:
if myBool = "STOP" then ... some exit code from the loop.

Finally cvsApp.Servers(1) is not always the correct way to get your running server. It can be cvsApp.Servers(2) or even cvsApp.Servers(3), this can happen if you have more than one instance running because let's say you ended up with some orphaned objects because your application crashed. You can check your Windows Running Tasks and if you see many Avaya objects piled up terminate them and restart the application and you will go back to cvsApp.Servers(1) not causing problems. Another method is to loop via each cvsApp.Servers(i) and check which one is alive then connect to it.

Please Log in or Create an account to join the conversation.

More
5 years 4 months ago - 5 years 4 months ago #685 by novemberoyce
Sorry about that roller.

regarding the cvsApp.Servers(i), will this still be applicable if I'm logged into CMS Supevisor Application?


Many Thanks,
Holly
Last edit: 5 years 4 months ago by novemberoyce.

Please Log in or Create an account to join the conversation.

More
5 years 4 months ago #687 by roller
I do not use Avaya so I no longer have a place to test the code. cvsApp.Servers(1) will only work if you are logged in the Avaya application. If you don't want to be looged in you can log in via VBA and create your own server connection - there are few examples here. If you want to use the connection already open by the Avaya application then you must log in. Sometime if it crash the server may not always be on number 1 so you can add some additional logic to check where it is. You use something like this to check which one is open:

Srvopen = cvsApp.Servers.Count
If (Srvopen > 0) Then

For i = 1 To Sropen
Set cvsSrv = cvsApp.Servers.Item(i)
Debug.Print cvsSrv.Name

If cvsSrv.Name = "your serer IP or name - repace this" Then

Exit For
Else
CMSLogin = False
End If
Next i

Please Log in or Create an account to join the conversation.

Time to create page: 0.504 seconds
Powered by Kunena Forum