I am trying to select the file which is already opened in quickbook software.
code :
OpenFileDialog ofdBrowseVInv = new OpenFileDialog();
ofdBrowseVInv.Title = "Locate QuickBook Company File";
ofdBrowseVInv.Filter = "QuickBook Company File (*.qbw,*.qbw)|*.qbw;*.qbm";
ofdBrowseVInv.FileName = "";
if (ofdBrowseVInv.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
string strfilename = ofdBrowseVInv.InitialDirectory + ofdBrowseVInv.FileName;
}
After selecting the file .. i am getting message : File in use
can any one tell me how can i select the file which is already opened...
The following code seems to help:
ofdBrowseVInv.ValidateNames = false;
see more here http://social.msdn.microsoft.com/Forums/vstudio/en-US/56fbbf9b-31d5-4e89-be85-83d9cb1d538c/openfiledialog-this-file-is-in-use?forum=netfxbcl
This code worked for me perfectly.
ofdBrowseVInv.ValidateNames = false;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With