UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
2 Pages V  1 2 >  (Go to first unread post)
   Reply to this topicStart new topic
> Ms Office Activation Wizard, Access 2013    
 
   
azizrasul
post May 30 2020, 07:30 PM
Post#1



Posts: 1,551
Joined: 18-July 00
From: Faisalabad, Pakistan


Is there any VBA code that will automatically close the MS Office Activation Wizard dialog box?

--------------------
Aziz
Go to the top of the page
 
GroverParkGeorge
post May 31 2020, 07:43 AM
Post#2


UA Admin
Posts: 37,447
Joined: 20-June 02
From: Newcastle, WA


I'm trying to picture a scenario where this would be even necessary. You install a new version of Office and activate it. But you only do that once, do you not? Why would you need or want to automate it from VBA?


--------------------
My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
DanielPineault
post May 31 2020, 08:55 AM
Post#3


UtterAccess VIP
Posts: 7,375
Joined: 30-June 11



I suppose you could get into APIs to find the window and work with it, but as George states I don't see why that would ever need to be automated in Access.

--------------------
Daniel Pineault (2010-2020 Microsoft MVP, UA VIP, EE Distinguished Expert 2018)
Professional Help: https://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: https://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
FrankRuperto
post May 31 2020, 09:41 AM
Post#4



Posts: 1,099
Joined: 21-September 14
From: Tampa, Florida USA


QUOTE (Aziz)
Is there any VBA code that will automatically close the MS Office Activation Wizard dialog box?


I am assuming you are using a trial version of Office which has not been activated. If your objective is to bypass activation, keep in mind that many features, such as saving Excel and Access databases, are disabled until Office has been activated.

--------------------
Currently supporting pawnbrokers that use my store management system developed with Access 2010 on Windows7. Experienced with Informix, Oracle & PostgreSQL db's.
Go to the top of the page
 
azizrasul
post May 31 2020, 09:45 AM
Post#5



Posts: 1,551
Joined: 18-July 00
From: Faisalabad, Pakistan


I am creating a run time utility in MS Access, where some operation will take place on an external MS Excel file. If the user has an unactivated MS Office version, my code has a problem. The code I am using opens the MS Excel file that the user desires and sets Visible to False. However, if Office has not been activated, the Activation wizard dialog opens in modal mode that the user cannot see. Hence my code hangs as this dialog box needs to be closed. If there is VBA code that 'detects' that this dialog box is open, I can close the MS Excel file and generate a message box to say in effect that the user needs to activate their MS Office version before using my utility.

Alternatively I can set the MS Excel object visible to True and detect whether the Activation Wizard dialog box is open and close it using VBA. I can then also generate a message box to say please activate your version of MS Office. If on the say, 3 attempts, the dialog box is not closed and only the warning message box appears.

Hope that makes sense. Here's my current code.

CODE
Set objExcelApp = CreateObject("Excel.Application")

With objExcelApp
     .Workbooks.Open FileName:=strFilePathandName
     .Visible = False
End with

--------------------
Aziz
Go to the top of the page
 
FrankRuperto
post May 31 2020, 09:52 AM
Post#6



Posts: 1,099
Joined: 21-September 14
From: Tampa, Florida USA


QUOTE (Aziz)
I am creating a run time utility in MS Access, where some operation will take place on an external MS Excel file. If the user has an unactivated MS Office version, my code has a problem


If Office is not activated, Excel is restricted to read-only and your vba that automates Excel will fail. There's no way to bypass unless Office is activated.

--------------------
Currently supporting pawnbrokers that use my store management system developed with Access 2010 on Windows7. Experienced with Informix, Oracle & PostgreSQL db's.
Go to the top of the page
 
azizrasul
post May 31 2020, 10:27 AM
Post#7



Posts: 1,551
Joined: 18-July 00
From: Faisalabad, Pakistan


OK I understand. Is their a way of detecting the activation wizard dialog box using VBA so that I can close my code and generate an appropriate message box for the user? This would be much better than my code just hanging and waiting for the user to close the activation wizard dialog box. Don't really know how to use API's as suggested.

--------------------
Aziz
Go to the top of the page
 
FrankRuperto
post May 31 2020, 10:42 AM
Post#8



Posts: 1,099
Joined: 21-September 14
From: Tampa, Florida USA


Which error is it throwing?... You could trap the error, but I would leave the activation wizard popup since you do want the user to active Office, right?
This post has been edited by FrankRuperto: May 31 2020, 10:44 AM

--------------------
Currently supporting pawnbrokers that use my store management system developed with Access 2010 on Windows7. Experienced with Informix, Oracle & PostgreSQL db's.
Go to the top of the page
 
GroverParkGeorge
post May 31 2020, 10:55 AM
Post#9


UA Admin
Posts: 37,447
Joined: 20-June 02
From: Newcastle, WA


Is there a specific scenario where you've already encountered this problem? I.e. have you previously deployed your relational database application to one or more people who are trying to use a non-activated Office installation?

To me, it seems like a very low frequency problem and one that may not be worth the time and effort for YOU to resolve.

That said, can you provide more details, as Frank requested, on what those "users" actually saw?

--------------------
My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
azizrasul
post May 31 2020, 11:25 AM
Post#10



Posts: 1,551
Joined: 18-July 00
From: Faisalabad, Pakistan


As my code has set the Visible property to False on the MS Excel object, the test user saw nothing as my code just hangs because the Microsoft Office Activation Wizard dialog box is there but can't be seen. However when I ask the test user to change the Visible property to True on his machine, then the MS Excel file opens and since they don't have the full version of MS Excel at the moment, the Microsoft Office Activation Wizard dialog box appears. If the user presses the Close button on this dialog box, then my code continue's on it's merry way. If the user doesn't close the Activation box, then the Switch|Retry|Cancel dialog box appears. If the test user presses Switch, then everything is OK. Hope that makes sense. So no error message.

So, ideally, what I want to do is to keep the Visible property to False AND 'detect' whether the Microsoft Office Activation Wizard dialog box is present, if someone has a trial version or unauthorised version, and hence generate a message box to the user to activate their product and close my code gracefully. I am at the test phase, and during the writing of my code, I didn't realise I would get this issue. You can't think of everything.
This post has been edited by azizrasul: May 31 2020, 11:32 AM

--------------------
Aziz
Go to the top of the page
 
GroverParkGeorge
post May 31 2020, 11:37 AM
Post#11


UA Admin
Posts: 37,447
Joined: 20-June 02
From: Newcastle, WA


"As my code has set the Visible property to False on the MS Excel object...."

Perhaps that's the clue to the solution. Don't set the MS Excel object visible property to false and the problem goes away.

But that, in turn, calls for another question. What are you actually installing here, an Access relational database application using Access, or something involving Excel? And if Excel is not activated, wouldn't that also apply to Access as well? After all, they are both part of Office. Or better yet, as part of your installation documentation, point out to potential users that they must activate Office on their computers FIRST, then they can install you relational database application.

Ultimately, the way you'd have to find that Activation dialog would be, as suggested, invoke a Windows API to find it....


--------------------
My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
azizrasul
post May 31 2020, 12:16 PM
Post#12



Posts: 1,551
Joined: 18-July 00
From: Faisalabad, Pakistan


I am creating a run time version of a MS Access database to be purchased by the public. Hence the end user could have a legitimate copy of MS Office or not as the case may be. For those who purchase a legal copy, there is no problem as the dialog box will not appear. But for those who don't have a legitimate copy, it will appear. The object is not for the user to use my software if they have an illegal copy of MS Office. But as my code 'hangs' it essentially gives a bad impression of my software and the end user could potentially give me bad reviews even though my utility is not to blame.

If the Visible property is set to True, then in effect the end user who doesn't have a legitimate copy of MS Office will be able to use my utility by pressing Close on the Activation dialog box, hence the reason, ideally, where I want to detect the Activation dialog box, if possible, with the MS Excel object hidden. Hope that makes sense.

That's a good idea GroverParkGeorge, to ask the end user that my software will NOT work if they have an unactivated copy of MS Office.
This post has been edited by azizrasul: May 31 2020, 12:24 PM

--------------------
Aziz
Go to the top of the page
 
GroverParkGeorge
post May 31 2020, 12:28 PM
Post#13


UA Admin
Posts: 37,447
Joined: 20-June 02
From: Newcastle, WA


Ah, well that makes sense. You are trying to sell a relational database application built on Access.

Unless you have the time to dig into the APIs necessary to work with those "hidden" windows as Daniel first suggested, I think you'll have to anticipate that some people will have problems if they either don't have Office installed at all, or have only an unactivated trial version. But in those two cases, perhaps a simple warning is what you really need.

"You must have a fully licensed and activated version of Office installed on your computer before installing this Access relational database application." I mean, how far do you need to go to accommodate people?

I assume you have already encountered that problem, though, hence the question here.

So here's another thought. Would the Access run-time be an alternative to requiring an activated Office license? Does your application REQUIRE MS Excel in addition Access?

If you require Excel, I think you might either want to acquire and work with some version of Installation software, such as Inno Setup to ensure all prerequisites are in place, or invest in the study of Windows APIs. Albert Kallal and others have extensive experience with Inno should you decide to go that direction.

--------------------
My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
azizrasul
post May 31 2020, 12:50 PM
Post#14



Posts: 1,551
Joined: 18-July 00
From: Faisalabad, Pakistan


As the user may not have MS Access but will have MS Excel, I decided to go for a run time version of MS Access. I could have written the code in MS Excel, but as the VBA code password can be cracked, I decided that MS Access would be a better option as the code can be hidden in a accde extension.

The person who is testing my incomplete utility has pointed out the issue which is why I am addressing it.

--------------------
Aziz
Go to the top of the page
 
FrankRuperto
post May 31 2020, 01:33 PM
Post#15



Posts: 1,099
Joined: 21-September 14
From: Tampa, Florida USA


Given the circumstances, I feel the best approach is for you to inform potential buyers upfront that your Access app integrates with Excel and an activated Office version is required for that component of your app to work. I'm not sure if Excel is available as a standalone product like Access is. If user doesn't have Office/Excel activated, then you could add error handling to the vba sub that's referencing the Exccel object and display a generic error msg that Excel is not available and to contact you, or other msg, and "Press OK to continue."

Depending on what your app is doing with Excel, it might also be possible to do it in Access, e.g. Chart, fancy report, pivots (in Access2010), Export/Import CSV, etc.

QUOTE
but as the VBA code password can be cracked,

Just so you know, the password can also be craked in Access, albeit harder to do if you setup the frontend properly.
This post has been edited by FrankRuperto: May 31 2020, 01:45 PM

--------------------
Currently supporting pawnbrokers that use my store management system developed with Access 2010 on Windows7. Experienced with Informix, Oracle & PostgreSQL db's.
Go to the top of the page
 
azizrasul
post May 31 2020, 02:20 PM
Post#16



Posts: 1,551
Joined: 18-July 00
From: Faisalabad, Pakistan


As far as passwords are concerned, yes I agree that the password can be cracked in MS Access as well. But the beauty of MS Access is that you can hide the code. Otherwise I will go to all the trouble of writing the code and it can then be copied by someone else.

The utility will make changes only to MS Excel files, so the buyer will need to have MS Excel in the first place.

QUOTE
... you could add error handling to the vba sub that's referencing the Exccel object and display a generic error msg that Excel is not available and to contact you ...

How would the error be triggered? I have the following lines

CODE
objExcelApp.Visible = False
intWorksheets = objExcelApp.Worksheets.Count

If intWorksheets > 1 Then 'CODE HANGS HERE
      some code
EndIf

--------------------
Aziz
Go to the top of the page
 
FrankRuperto
post May 31 2020, 06:18 PM
Post#17



Posts: 1,099
Joined: 21-September 14
From: Tampa, Florida USA


Use the "On Error Resume Next" statement. This allows execution to continue when a run-time error is encountered. You can place the error-handling right after where the error is happening. Have it display a msgbox with the information you want the user to read so he can press the OK button. Then you want to exit the sub and decide where you want the form to navigate to.

--------------------
Currently supporting pawnbrokers that use my store management system developed with Access 2010 on Windows7. Experienced with Informix, Oracle & PostgreSQL db's.
Go to the top of the page
 
azizrasul
post May 31 2020, 06:58 PM
Post#18



Posts: 1,551
Joined: 18-July 00
From: Faisalabad, Pakistan


Thanks, I will try that.

--------------------
Aziz
Go to the top of the page
 
azizrasul
post Jun 1 2020, 02:44 PM
Post#19



Posts: 1,551
Joined: 18-July 00
From: Faisalabad, Pakistan


On Error Resume Next, unfortunately didn't help. The reason I think it won't work is that there is no error. The codes justs hangs waiting for the user to close the "Microsoft Office Activation Wizard" dialog box.

I have changed the Visible property to True and using

CODE
objExcelApp.Activate

which switches to the MS Excel file. The user can now see that they have an unactivated MS Office. How do I now return back to my code and hence close my utility?
This post has been edited by azizrasul: Jun 1 2020, 03:17 PM

--------------------
Aziz
Go to the top of the page
 
FrankRuperto
post Jun 1 2020, 03:27 PM
Post#20



Posts: 1,099
Joined: 21-September 14
From: Tampa, Florida USA


Understood. There are Windows Registry Keys that can tell you whether Office is activated, so perhaps your vba can check these keys before attempting the Excel automation:
http://woshub.com/checking-office-2016-365...ivation-status/

You can also remove the Office 2013 activation prompt by removing the registry key (depending on the bitness of the system):

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\15.0\Common\OEM
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\15.0\Common\OEM

It is faster to do it in PowerShell:

Remove-Item –Path “HKLM:\SOFTWARE\Wow6432Node\Microsoft\Office\15.0\Common\OEM” –Recurse
Remove-Item –Path “HKLM:\ SOFTWARE\Microsoft\Office\15.0\Common\OEM” –Recurse
This post has been edited by FrankRuperto: Jun 1 2020, 03:40 PM

--------------------
Currently supporting pawnbrokers that use my store management system developed with Access 2010 on Windows7. Experienced with Informix, Oracle & PostgreSQL db's.
Go to the top of the page
 
2 Pages V  1 2 >


Custom Search


RSSSearch   Top   Lo-Fi    4th July 2020 - 02:01 PM