When loading an image with Image.FromFile the picturebox control locks the file so you get an exception when you try to delete it.
After long research I found the following solution, does anybody know something more elegant?
If Not (myPic.Image Is Nothing) Then
'get rid of any former...
Good old DOS:
Redirect the output of the command to a file!
Lets assume your command is named DOIT.EXE
Kill "Output.Txt"
dummy = Shell("DOIT.EXE > Output.Txt", vbMinimizedFocus))
'Now Output.Txt contains the output of DOIT.EXE
'Maybe you have to wait here for execution...
Hi there,
as far as I understand you want to programmatically start
an excel macro from your code. Maybe this is helpful:
Create an excel file named e.g. "C:\Progs\MyCode.Xls"
Record or write the code necessary to perform the required operations in a Public Sub in any VBA module...
The following source is from Access but should work under VB as well.
Create a file named Template.XLS and apply all formatting not depending on data pasted.
In code create a copy of your template, fill it, print it save it ...
Global Const xlUp = -4162
Global Const xlNone = -4142
Global...
First of all you should use Excel to record macros and analyze
the resulting code.
The following source is from Access but should work under VB as well.
Depending on the structure of your app, you may as well read the data directly from Excel or
create the excel files from your database app...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.