You can invest EPF fund at any time so long you have sufficient amount in your EPF account 1. Your eligible investment amount for EPF account 1 will refresh every 3 months.
Voiding a pending EPF investment order is not counted as a successful withdrawal.