Do you know why this happens?
Can you suggest a workaround, please?
If (strCampaignFolder <> "") Then 'Next line works fine when strCampaignFolder already has a value set by FolderBrowserDialog1.SelectedPath further below. FolderBrowserDialog1.SelectedPath = strCampaignFolder Else 'PROBLEM: Next line causes the external .NET code 'UnsafeNativeMethods' to put the app to sleep when strCampaignFolder has no existing value! FolderBrowserDialog1.SelectedPath = "L:\InternetMarketing\AdWordsCampaigns\LiveChat-Software" End If If FolderBrowserDialog1.ShowDialog() = DialogResult.OK Then 'Get Campaign folder strCampaignFolder = FolderBrowserDialog1.SelectedPath End If
Last edited by a moderator: