Please Check the below weblink
Alternatively you can check the below solution published on HP.
- Insert the software CD into the drive. If the CD does not automatically start, click Start , then Run . In the Run box, type d:\setup.exe (where D is the letter of the CD-ROM drive). When the Welcome Screen opens, click Next .
- Under Connection Type, select Wireless , and then click Next .
- If Notice about Firewalls screen opens, click Next .
- If an Internet Sharing screen opens, click Yes .
- If Windows XP Service Pack 2 is installed, a message may display about opening the ports on your firewall. Click Next .
- If Windows XP Service Pack 2 is installed, a Windows Security Alert message may state that the Windows Installer program is blocked. Click Unblock .
- If the printer is found, follow the directions on the screen. Click Next .
- Temporarily connect over an Ethernet connection. Wait for the green network icon to be on and steady, then select Yes, the cable is plugged in . Click Next .
- Choose Search Again , and wait for the software to find the printer.
- Confirm the correct printer was found and click Yes, install this printer .If not sure that this is the right HP Deskjet 6840, print a network configuration page by tapping the checkmark icon and compare the IP address.
- If the network has WEP settings a message will open prompting to enter them here. All devices on the wireless network must have matching security settings. Enter the network’s WEP key and click Next .
- Click Next to accept the wireless settings or select Change Settings to change them.
- Disconnect the Ethernet cable. Now that setup can communicate with the printer over 802.11, disconnect the network cable. Follow the steps below to do this.
- Disconnect the cable from the printer.
- Wait for the Blue Wireless light to turn on and steady.
- Wait for the network connection light to be green and steady.
- Wait for the signal strength indicator to be at the 2nd or 3rd setting.
- Click Next .
- On the next screen, click Yes, install this printer . Follow the directions on the screen to complete the installation.