Archive for 2023

October 9th, 2023
5:50 pm
Backing Up Office 365 OneDrive files

Posted under Knowledge Base & MS Office & Windows & Windows 11
Tags , ,

I was looking for a good way to do this immediately following the issues I hit changing the username domain on Office 365.

After experimenting with doing large zip downloads to back up locally, which was intermittent with large downloads, I found this post here and I did the following, do force all OneDrive files to be synched locally all the time:-

  • I unlinked OneDrive by visiting Account under settings and clicking “unlink this PC”. I then visited the OneDrive local folder root, which was under c:\Users\SteveW\OneDrive (for my free hotmail OneDrive) and  “c:\Users\SteveW\OneDrive – Salient Soft” for my Office 365 business account, and moved them along with all the files, to the correspponding directory on the D Drive. I then visited One Drive again in the system tray and re-added the account/username, picking the link to browse for a different folder, and browsed for the new folder. When I did this it warned that files were already present, which was fine as I had just moved them, so I told it to continue. This allowed me to move from the default drive to my preferred non-system drive which had more disk space.
  • I again visited OneDrive in the system tray, and opened Settings, then selected Sync and backup on the left menu, and picked advanced settings
  • I then visited Files on-demand (noting the help link which is the above post), and selected “Download all files”. Once I allowed this to synchronise fully, after a few hours, all the files were downloaded locally.
  • I then just needed to do local backups as normal, as my local copies of the cloud would be fully up to date.

Comments Off on Backing Up Office 365 OneDrive files

October 9th, 2023
5:31 pm
Changing Office 365 to remove Ltd Company reference

Posted under Knowledge Base & MS Office & Windows & Windows 11
Tags , ,

As I was no longer trading via a limited company, I wanted to remove the “Ltd” references to my organisation and URLs in Office 365.

One key point was that the login username was SteveWoodley@SalientSoftLtd.onmicrosoft.com, and I wanted to remove the Ltd. Office 365 support advised on this and I did the following:

  • I added a new domain as above without the Ltd. To do this, I visited the admin centre, clicked “Show All” on the left menu, and then dropped down the settings menu, again on the left. I added the new domain, and also clicked the button to make it the fallback domain.
  • I then selected users under the active users menu, selected my user, and then clicked the link for “manage username and email”. I then clicked the pencil to edit the primary username and email, and selected the new domain that I had just entered above.
  • I did this again for all the usernames.
  • I noted that when I visited onedrive, the URL root showed as “https://salientsoftltd-my.sharepoint.com/”, i.e. it still had the “Ltd” in it. After searching online, this post here states that you cannot change this as it is the tenant domain name. It would mean creating a new tenant/Office 365 subscription and moving all the data, settings etc. from the old to the new. As this was not a big deal, and as the support staff did not see this as a problem, I left it alone, and was happy that at least the username was corrected.

After this was done, I found that onedrive could not see all the files and was concerned about lost files. I did note that under the user settings, there is a OneDrive menu which allows you to create a link. This in fact created a working link, but the main OneDrive link from the admin etc. continued not to work.

Support advised just waiting a day to allow the changes to be resynchronised correctly at the server end. I did this, and it did indeed work out fine with everything working.

I had also initially had issues with OneDrive for Windows 11 immediately after the change, regarding use of the modified username/domain, and could not see the files. Again, this all sorted itself out after a day or so and everything was fine.

Comments Off on Changing Office 365 to remove Ltd Company reference

September 6th, 2023
1:15 pm
EE Mobile Router Backup via Fritzbox 7530 – USB Extender and topup issues

Posted under Hardware & Knowledge Base & Networks & PC
Tags , ,

This follows on from my previous post here.

Addition of a USB extender

As before, the mobile router performed around 4 times faster in the wooden garden office than in the brick build house, so it made sense to locate the router there when in use. However, I still wanted to allow shared internet around the house and on wifi when using the backup, and doing this another way e.g. by trying to share the connection from a windows PC in the garden office was not straightforward, and prevented the features of the Fritz box like its wifi from being used. I therefore obtained an EZCOO 50m USB extender for this, to allow the mobile router to still be connected to the Fritz Box in the house, but located in the garden office. When initially connecting the EE router to my TV PC via the USB extender, I received errors like “The last USB device you connected to this computer has malfunctioned and windows doesn’t recognize it”. Initially This appeared to be cable length related, as if it was a data corruption issue, as it failed on a full run to garden office with generous 7m flex cable at garden end. The full run was likely around the 50m max that was quoted by the EZCOO usb extender. However, this can also be caused by usb driver related issues. I tried to shorten the run by using the shortest cables I could each side of the Cat6 SWA run to the garden office. After this tidying up and retrying, the EE mobile router connected ok.

Significantly, I also received this error when testing the connection with my S22 Ultra mobile, again over the extender. However, when switching to using an older IOCELL Netdisk backup disk via its USB2 connection, it connected fine, which would tend to point more to driver or usb compatibility issues. Crucially, the Netdisk was able to copy significantly sized files both ways successfully over the full distance, indicating that the USB extender was working fine. Also and importantly, connecting the mobile router via the extender to the Fritz Box worked fine – the fritz box did not complain and always connected, but as always generally takes several minutes to switch over correctly between the primary and backup provider.

I continued to try file copying tests over the EE router connected to the TV PC via the extender, and these were all successful including 2-3GB copies to and from a OneDrive share. One issue that muddied the waters a lot was Windows file system caching of data both under Windows and with OneDrive – this led me to think copying had been completed when it hadn’t, or when a cache had been used to avoid the copy. Once I eliminated these issues all the tests were fine.

After retesting again today I had no problems connecting or speed testing, including tests done with the mobile router connected to the Fritz Box. I have had an occasional issue where speed test upload test did not work at all. I think that this may be a general ee mobile contention issue and perhaps if the upload link is too slow, ookla speed test just doesn’t bother and gives up.

DNS Issues

During the last couple of days, DNS has not been an issue with Zen overrides set, or by leaving the provider defaults. DNS still seems like it might be an issue, so it may be necessary to try another free public override on the DNS. The top rated free public servers are generally Cloud, Google, and OpenDNS, and details of these may be found on TechRadar here or on Broadband Genie here.

Points re topup and sim expiry

The terminology and process on this was not entire clear initially:-

  • Firstly you need to purchase more credit, using a credit card, via ee.co.uk/topup . This can be done from any internet connection, by entering the mobile router phone number twice to authenticate (you don’t need a password to do this). The number was not listed in the paperwork for the router so I wrote it down on the paperwork for convenience.
  • After you top up, i.e. buy credit, you need to visit add-on.ee.co.uk/purchase to get additional data using the credit you just purchased. Note that the word ‘purchase’ in the url here is ambiguous as you have already made a purchase with a credit card – you are just cashing in your credit to buy data. Note that in order to do this stage, your PC must be directly connected to the mobile router, i.e. you cannot be connected via the fritz box, even when it is in backup mode with the mobile router active. You get a choice of sizes, and you must have purchased enough credit previously to cover the size you want.
  • In addition, it appears that there is a 6 month sim expiry issue for the PAYG sim used in the mobile router, as per here. You need to not just use the mobile router but also spend money every 6 months (180 days) or the SIM expires and you also lose any credit you had. You can phone EE to recover an expired SIM as detailed here, but if after 273 days you have done nothing, the sim and number expire completely and you will need a new sim and number. Therefore I decided my best option if not needing the backup for extended periods is to use it around twice a year before the 180 days expires, and buy the minimum minutes package (which is £5 at the time of writing).

Comments Off on EE Mobile Router Backup via Fritzbox 7530 – USB Extender and topup issues

July 18th, 2023
4:56 pm
Surface Pro 4 Keyboard not working

Posted under Hardware & Knowledge Base & PC & Windows & Windows 10
Tags ,

We have had this issue a number of times, where the cover keyboard just won’t work, even after rebooting several times.

This appears to be a common problem which is griped about online, and the solutions are varied, not that clear/consistent, and do not always work. I even replaced the cover keyboard, which did fix the problem at the time, but I then later found that the original one still worked!

IMO this looks like some kind of underlying bios problem.

After trying a number of ideas which did not work, including removing the keyboard driver, and disabling/re-enabling the keyboard in the UEFI bios, I found that booting into the UEFI bios (hold +volume button whilst pressing on button), and then rebooting again, seemed to work.

This site here appeared to have some helpful ideas, including running the keyboard troubleshooter, which I had not seen previously. As the troubleshooter initially said that there were no problems (!), I had to run additional troubleshooters and then select keyboard, as per the post, for it to work. In my case, the troubleshooter ran fine, but the keyboard was already working, so I’ll have to wait until next time to see if this helps to solve the problem, should it occur again.

Comments Off on Surface Pro 4 Keyboard not working

June 22nd, 2023
3:05 pm
Angular – Dynamic Routing between Angular Elements aka Web Components

Posted under Angular & Routing & Web
Tags

Following on from my previous post on dynamic routing fundamentals, the ability to route dynamically across angular elements, i.e. to use the router to route to a dynamically loaded angular element, seems to be a sticking point.

Previously, I developed a web components example where a ‘fabric’ component was responsible for dynamically creating web components and displaying them. This did not use angular routing, but dynamically added them to the dom based on menu selections or url parameters. Subsequently, I wanted to investigate whether I could use angular routing to implement this instead.

I have found a number of examples of varying degrees of complexity, which go at least some of the way. However, I have not seen what I would term a reasonably straightforward, out-of-the-box solution, which does not involve too much deep diving into the internals of angular.

The following examples have been examined to date:

A complex dynamic one here with perhaps useful ideas but actual components still appear to be declared in the angular app:
https://medium.com/ngconf/dynamic-component-generation-in-lazy-loaded-routes-d2e0f9e89c57
The code is here:
https://github.com/theAlgorithmist/Angular8LazyLoadDynamic

Some specific ideas in this one here but still some way to go IMO…
https://medium.com/@timon.grassl/how-to-use-routing-in-angular-web-components-c6a76449cdb

This one perhaps looks the most promising, and may have all the relevant techniques needed, but It still appears to have statically declared component objects which are used dynamically in a dynamic order…
https://snyk.io/advisor/npm-package/angular-elements-router

Some more research is needed on this as I am keen to fine the simplest solution which uses as little as possible of the deeper features of angular.

 

Comments Off on Angular – Dynamic Routing between Angular Elements aka Web Components

June 22nd, 2023
10:47 am
Angular Dynamic Routing

Posted under Angular & Knowledge Base & Routing & Web
Tags ,

One of my goals is to be able to dynamically create routes based on configuration data, typically loaded at pre-init time using an app initialiser.

Two approaches I have seen to doing this are as follows:

  1. Using a custom Injector to use code to inject the routes.
    This is done in this example here. The code for it is available here.
  2. Using Router.resetConfig() to change the routes after initially creating them.
    This is done in this example here. The code for it is available here.
    It is also done in this example here, in the app initialiser.

Both are dynamic, but method 1/ with the injector runs before any app initialiser, so would not be suitable for my needs (I verified this with a simple test with console logging). If this were used, any dynamic config would need to be fetched within the injector code or called directly from it. Method 2/ can be used after the app initialiser – I tried calling it successfully from the ngOnInit lifecycle hook in the app component which worked fine.

This example here uses method 1/, and the code for it is on github here. I downloaded the code and modified the original version, as it contains errors in the time of day checking code. I then saved the project to bitbucket. I branched it and modified it again to use resetConfig as above from ngOnInit, and removed the injector mechanism. This also worked fine.

Whilst these approaches allow dynamic creation of the routes, they assume that the routed components are known to the application or declared in it in some form. The basis of the standard approach to routing is that the component class referred to in the route is looked up, and its selector is extracted and used to create the component tag dynamically, inserting it after the appropriate <router-outlet>. This would not work in the case of angular elements, i.e. W3C web components. These are entirely dynamic and my examples which use these in the past have the element name/component tag defined dynamically as part of the config, along with the names of the scripts to be loaded to create the web component. Another approach will need to be investigated to look into routing of angular elements.

Comments Off on Angular Dynamic Routing

June 22nd, 2023
8:08 am
Angular Routing

Posted under Angular & Knowledge Base & Routing & Web
Tags ,

These points were found whilst trying some angular router examples.

Examples tried were these. Note that they are all on Stackblitx, and therefore zips can be downloaded.
It is not obvious how, but just make sure the project panel is open by clicking on the 2-page icon near the top left. Then click on the small cloud icon containing the down arrow, on the RHS of the project panel title.

  1. https://www.tektutorialshub.com/angular/angular-routing-navigation/
  2. https://stackblitz.com/edit/angular-ivy-spsz1g?file=src%2Fapp%2Fapp.component.ts
    Note that this one above is angular 15 so pretty up to date
Here are the official angular ones:
  1. Basic one with just 2 router states/2 buttons
    https://angular.io/guide/router-tutorial
  2. Full Tour of Heroes tutorial
    https://angular.io/guide/router-tutorial-toh 
    This above one is angular 16 so latest
 
Points on configuring and using routes:
  1. Routes are defined using RouterModule.forRoot. In some examples the route definitions/routes array is defined in app.module.ts (as in the basic angular.io example above). More typically the routes array is defined in a separate file to separate the concerns, such as app-routing.module.ts or app.routes.ts. It can then either be exported from this file and referenced in app.module.ts via RouterModule.forRoot (as in the tektutorials example above), or RouterModule.forRoot is itself also in the separate file defining the routes (as in the full Tour of Heroes example above, in app-routing.module.ts).

  2. In all the examples, routing is done by creating a component and placing it as a sibling of the <router-outlet>tag, immediately after <router-outlet>. The created component is never placed as a child of the <router-outlet>. As per the full Heroes tutorial, <router-outlets> can be nested where required – a component activated from a <router-outlet> can then use other routes to activate further child components etc.

  3. When refreshing e.g. a child page on zen apache or http-server, I got 404 errors. It is necessary to tell the server to redirect to e.g. index.html or whatever you are using, to get the routing to work. This was not the case when using “ng serve” as this takes care of the issue for you automatically. The same problem happens if you enter a url manually or from a link, to go to a detail child route page. This angular.io deployment page explains how to do this for various servers, including apache as used by Zen in my case. In my case I tested on Zen and needed to edit .htaccess as per the instructions. For this to work, I had to change the path in the instructions to the correct subdomain index.html file or it still failed. I also created a child .htaccess file in the subdomain folder where my app was hosted. This ran in addition to the main .htaccess, and it all worked fine. I did notice that the lowest child hero pages on the full tour of heroes example above still failed with a 404. However, they also failed with a 404 when served via “ng serve”, so I concluded that this was a coding issue in the example and did not investigate further. My .htaccess for the full heroes example under zen was as follows:-
RewriteEngine on

RewriteOptions inherit

# BEGIN Angular Routing

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR] 
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d 
RewriteRule ^ - [L] 

# If the requested resource doesn't exist, use index.html 
RewriteRule ^ /angular-router/angular-full-heroes-example/index.html

# END Angular Routing


When a route is activated, its target component is always recreated and any previous component for the corresponding <router-outlet> is destroyed. I confirmed this with all the above examples by logging in the ngOnInit and ngOnDestroy life cycle methods. Components are not switched in and out by showing and hiding.

For me, if I wanted to use web components with routing, I had thought that dynamic target component recreation might create an overhead as they would need creating each time, by dynamic loading/running of all their run time js scripts (e.g. main.js, runtime.js, vendor.js). I had considered using componentless routes to avoid this overhead, and do my own creation in a route resolver.
 
However, in fact, it looks like the running of their creation scripts is a separate operation that only needs doing once. The angular router just appears to create and delete element tags from the dom, so the deletion of a tag and subsequent recreation should not require reloading the scripts, so if correct I could do the script loading in a route resolver once, the first time the script is loaded (or earlier if I am doing eager loading). I could then let angular do what it likes re adding and removing elements.
 
I intend to try this out with my existing web components/microapps demo – at present it hides/shows microapps when switching between them, but it looks like I could change this to removing/recreating the microapp elements, but only loding the script once. This would easily validate this idea.
 
In addition to this I would want to make the component name in a route definition dynamic and load it server side, and perhaps also dynamically load the route definition or at least dynamically create it from server side parameters and a template definition. This appears to be possible and this post here looks into it. This other post also looks into it with lazy loading. Significantly more investigation is needed on this.
 
 
 
 

Comments Off on Angular Routing

April 13th, 2023
4:59 pm
EE Mobile Router Backup via Fritzbox 7530

Posted under Hardware & Knowledge Base & Networks & PC
Tags , ,

I obtained an EE mobile router as backup for the occasions when my main FTTC internet goes down. The main internet went down recently for and extended period due to an OpenReach Fibre connection issue to the exchange.

EE have the best mobile data coverage for my area per the ofcom coverage site here.

Zen internet sent me an EE mobile router as backup during the above outage (I presume they knew that EE had the best coverage in my area).

I was able to readily plug the router into a PC and get mobile coverage.

However, doing this via my Fritzbox 7530 needed some tweaking. The fritzbox has mobile internet backup capability via a submenu on its internet menu. This allows enabling the mobile router (plugged in via its usb port) as a backup only when the main internet is down.

Initially when I tried this having unplugged the main DSL connection, the internet showed as up, but DNS translation did not work. I found that under the internet menu/Account Information/DNS Server settings, I had overridden the DNSV4  servers provided by the ISP with specific Zen ones. Once I returned this setting to “use DNSv4 servers assigned by the internet service provider (recommended)”, DNS then worked on the mobile connection. In addition, automatic failover to mobile worked correctly when I unplugged the DSL connection, although this did take a few minutes to stabilise and was not instant.

In practice, I planned not to leave the mobile router plugged in, but to connect when needed. However, the fact that it is capable of providing shared internet and wifi via the router to my whole network was a real plus.

I found that the EE mobile router performed particularly well from my garden office (which is of wooden construction). I obtained approx 50Mb down and 1 Mb up in this situation – the down link speed was actually better than my FTTC which is around 32Mb. However in the house via the Fritzbox 7530, this reduced to around 20Mb down, presumably due to the brick construction blocking the signal more than the wooden building did.

However, in both of these situations the mobile data rate was way better than I had previously obtained by tethering my Vodafone Mobile – in the latter case, the connection was very slow and intermittent – sometimes I could not get a connection at all, so it would have been no use as a backup for remote working. The EE mobile router was perfectly suited for use as a remote working backup, although I planned not to leave it plugged in permanently as a hot backup but to manually plug in when required, as it was not instant anyway, and in practice I may have to buy additional minutes from EE as they seem to expire if you don’t use them within a set period.

 

Comments Off on EE Mobile Router Backup via Fritzbox 7530

February 7th, 2023
5:31 pm
Storing Office Macros

Posted under Knowledge Base & MS Office
Tags

I initially investigated office-js to store excel macros using angular and typescript, but in the end there was not enough in the way of working examples online, and the platform did not appear fully typescript enabled – there were a number of posts about missing capabilities in the typescript interfacing.

I then looked at the old-skool VBA macro recording and this was much more straightforward, even if it is somewhat legacy going forward.

  • To start with, you need to enable the developer tab via File/Options. This opens the way to all the macro capabilities.
  • From this tab, you can then click to record a macro, perform whatever actions you like, then click stop recording.
  • When you click to record a macro, you get the choice of current workbook, new workbook, or personal macro workbook. I would also have liked the option to record to a designated workbook of my own, but you can’t do this.
  • Fortunately, Macros are easy to copy around as source via the Visual Basic option on the developer tab. This opens a VBA view which shows all VBA from all currently open workbooks at once, so copying VBA between them is easy.
  • I will need to come up with a place to store my macros. As I am using them to reformat different transaction sheets to merge into a master workbook, it looks like the master workbook would be the place. Also you can use VBA to open any existing workbook so I could use VBA to open the workbook to import, from VBA in the master workbook, and then run the desired macros on them depending on the type of the imported workbook (which would be selectable on my open dialog).
  • Merging and editing macros, and copying between workbooks, is easy in the VBA view, as they all end up as VBA source. I intend to record a number of small atomic macros to do single actions. Each is saved as a separate method in a VBA module, so I can easily add another top level method to call them in turn etc. and add other logic. Very little VB/VBA knowledge is needed (as you might expect).

Whilst all this is perhaps a bit legacy compared with office-js (which itself does not appear to be fully supported for typescript and local use on all platforms), it is just so much less hassle than office-js for what I am trying to achieve.

Comments Off on Storing Office Macros