It really depends on how and when the Germans do it.
If they do it at the same time as Norway and Denmark, they will have a lot of problems. Their navy is not big enough to take out Sweden as well as Nroway in one big strike - Norway was extremely lucky, Sweden has far more population, mobilisation centras and industry inland, and most ports are protected by archipelagos that requires manouvering in narrow channels - which takes time.
If they do it at the same time as Norway and Denmark, both Norway and Denmark have the ability to fight longer and harder. Some Danes actually retreated to Sweden in April 1940, convinced Sweden was under attack and they could help even if Denmark fell. The Norwegian 1. Division retreated into Sweden in April and was interned. If Sweden is at war, it will be re-supplied and ready for action soon again, which means the Germans cannot advance up the Lillehammer valley to relieve the troops at Trondheim.
The Swedish army was not a superb force in 1940, but it was way, way, way better than the Norwegian army, and the Germans had serious problems with the Norwegians at Narvik.
A regular Swedish soldier had at least 240 days training 1940 (the Norwegians had 85), more if he was an NCO or an officer (Norway, 85 days here too). Most had done at least 100 extra days by then. Sweden had hand grenades, mines, AT mines, AT guns, AT rifles, and a handful of SMGs in each regiment. Norway had none of these.
Sweden had roughly 400 000 men in the army, plus another 100 000 in the Home Guard. The army had plenty of LMGs, decent amounts of MGs, plenty of medium (81mm) mortars, decent AT capacity rather good amount of AA (lacking in heavy and light, but good amounts of 40mm bofors). The army had learned as much as it could from the Winter War and the volunteers there and had been training hard since November 1939.
Hard data, armour:
48 Strv m/37 2xMG armed tanks.
9 Strv m/21 and Strv m/21-29 MG armed tanks in depots.
2 Carden-Lloyd MG carriers in depots.
1 Renault NC-27 MG armed in depots.
16 Strv m/38 37mm gun armed tanks with 20 more (Strv m/39) being delivered.
3 Strv m/31 37mm gun armed tanks in depots.
1 Strv fm/31 37mm gun armed wheel/track tank in depot.
21 Pbil m/31 2xMG armed armoured cars.
10 Pbil m/31 37mm gun armed armoured cars.
2 Pbil fm/25 MG armed armoured cars in depot.
1 Pbil fm/25 37mm gun armed (SA18 from the NC-27) armoured car in depot.
15 Pbil m/39 20mm gun armed armoured cars with 30 more (Pbil m/40) being delivered.
5 Pbil m/41 20mm gun armed armoured cars.
In field units:
48 MG armed tanks.
16 gun armed tanks.
21 MG armed armoured cars.
30 gun armed armoured cars.
In depots and training units:
12 MG armed tanks
4 gun armed tanks
2 MG armed armoured cars
1 gun armed armoured car
Hard data, planes:
~50 Gloster Gladiator Mk II, armed with Swedish 4 8x63mm MGs and having radios and reflector sights.
12 CR.42 armed with 2 12,7x81mm automatic cannons.
20 Seversky EP-35, armed with 2 13,2x99mm automatic cannons and 2 8x63mm MGs, equipped with armour, reflector sights and radio. 40 more were on ships from USA heading for Sweden.
~50 Junkers Ju 86.
~45 Fokker C.V used for recon.
~35 Hawker Harts used for dive bombing.
1 Northrop A-17 with 39 on the production line.
12 Heinkel He 115A-2.
~45 Heinkel He 5.
6 Hawker Osprey.
8 Fi 156 Storch.
Plus a smattering of ambulance, liason, transport, school and other aircraft.
Hard data, artillery:
~100 ww1 vintage 75mm field cannons - 7,5cm Kan m/02.
190 modernised 75mm field cannons (10km+ range) - 7,5cm Kan m/02-10 and m/02-33.
44 modern 75mm field cannons (10km+ range) - 7,5cm Kan m/40.
150 old fixed recoil 84mm cannons (6km range) - 8,4cm Kan m/81.
156 ww1 vintage 105mm field howitzers (6km range) - 10,5cm Haub m/10.
24 ww1 vintage 105mm cannons (11km+ range) - 10,5cm Kan m/17 and M/19.
64 modern 105mm field howitzers (10km+ range) - 10,5cm Haub m/39 (this is the German 10,5 leFH18) and Haub m/49.
56 modern 105mm field cannons (16km+ range) - 10,5cm Kan m27-34 and m/34
~50 old fixed recoil 120mm field cannons (8km+ range) - 12cm Kan m/85
68 ww1 vintage 150mm field howitzers (7km range) - 15cm Poshaub m/06 and Haub m/19
16 modern 150mm field howitzers (11km range) - 15cm Haub m/38
12 ww1 vintage 210mm howitzers (10km range) - 21cm Haub m/17
There's also a lot of weapons that have been lent, given or sold to Finland during the winter war. The Finns started passing arms to Sweden in March 1940 when the peace came and gave almost everything back in April. If Sweden is attacked, I am sure some Finns will volunteer, and a lot of arms will be going the other way.
One of the main problems for the Germans in any invasion are the distances and the terrain.
There is a single air field in Skåne at this time. Even if the Germans capture it, the Bf 109E have a combat radius of about 300km at the time - it will not even cover all of Scania. The Germans cannot escort bombers to Stockholm from Scania, anywhere in Norway or Denmark!
Almost all roads are single-file gravel roads, with heavy forest on eash side. The border towards Norway is the most sparsely populated, heavily wooded and/or mountainous, with very little infastructure. The ports are protected by extensive archipelagos which are almost all mined and protected by coastal artillery - it takes time to navigate through the archipelagos - Weserübing surprises are almost impossible.