|
PHDENG81 wrote:
ActiveWorkbook.XmlMaps("config_Map").Export URL:= _
"C:\TextXML.xml"
Tell there is a second, optional, parameter that specifies whether to overwrite the file or not. If not specified, it defaults to False, which is no overwrite.
ActiveWorkbook.XmlMaps("config_Map").Export URL:= "C:\TextXML.xml", Overwrite := True
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You are the man! Thanks for your help and the speedy response.
P
|
|
|
|
|
Is it true that 1 can use the eclipse IDE for developing vb.net applications.I had used eclipse for j2ee programming only till date.how to use it,if it could be used that is.
More dash than cash!!!
|
|
|
|
|
Hi,
Can any bosy tell me ?. What is difference between dispose and finalize in vb.net.
Regards
Rajesh
rajesh
|
|
|
|
|
I am trying to add the asscociated file icon in the listview(
lvwFileNodeList ).
I successfully add the icon for the first found file, but for the rest it
uses the
same icon to display the associated icon. As the following, i am adding the
file icon in the image list with the extension as a key and add this icon
when
adding this file to the list view. there must be the extra step i have to do
does any know what 'm missing?
my envrionment is vb6/xp pro
Me.ImageList2.ListImages.Add , FindExtension(strFileName),
GetIcon(strFilePath, SHGFI_SMALLICON)
Set objListItem = Me.lvwFileNodeList.ListItems.Add
objListItem.SubItems(3) = strFilePath
objListItem.SmallIcon = FindExtension(strFileName)
Public Function GetIcon(filename As String, icon_size As Long) As
IPictureDisp
Dim index As Integer
Dim hIcon As Long
Dim item_num As Long
Dim icon_pic As IPictureDisp
Dim sh_info As SHFILEINFO
SHGetFileInfo filename, 0, sh_info, _
Len(sh_info), SHGFI_ICON + icon_size
hIcon = sh_info.hIcon
Set icon_pic = IconToPicture(hIcon)
Set GetIcon = icon_pic
'GetIcon = sh_info.hIcon
End Function
' Convert an icon handle into an IPictureDisp.
Private Function IconToPicture(hIcon As Long) As IPictureDisp
Dim cls_id As CLSID
Dim hRes As Long
Dim new_icon As TypeIcon
Dim lpUnk As IUnknown
With new_icon
.cbSize = Len(new_icon)
.picType = vbPicTypeIcon
.hIcon = hIcon
End With
With cls_id
.id(8) = &HC0
.id(15) = &H46
End With
hRes = OleCreatePictureIndirect(new_icon, _
cls_id, 1, lpUnk)
If hRes = 0 Then Set IconToPicture = lpUnk
End Function
|
|
|
|
|
i want to execute an executable file from the interface created in VB.net.
i have an exe file named first.exe which needs to be called from a click of a button.
i found the general command for it.. as Shell("C:\first.exe",<parameters>)
this works fine.
what i want to do is try to execute the following command written in dos:
c:\> first < in.txt
and
c:\> first < in.txt > out.txt
thru VB button.
i need help for this.. urgent... :confused
|
|
|
|
|
Try specifying the command line parameters in the Shell() statement thus:
Shell("c:\first.exe < in.txt > out.txt")
...Steve
|
|
|
|
|
i tried that but it didnt work..
i'll explain my problem better..
- the in.txt contains few lines of code that is executed by the first.exe file . this exe file gives an output which i want to save in out.txt
problem with the suggested command
it opens the editor of the first.exe file rather than creating out.txt file which is not what i want it to do..
or is there any other command which allows us to perform my above mentioned task thru click of a button in VB.net
|
|
|
|
|
Ok, so first.exe reads in.txt and writes out.txt ? How do you normally specify the input and output to first.exe ? Is it a commandline program which expects these parameters or are you trying to get it to work differently from the way it was designed? If you have the source code for first.exe you can reprogram it whichever way you want but to call it from VB (or any other program for that matter) you'll need to adhere to the calling conventions expected by first.exe .
What you may need to do is to execute first.exe via cmd.exe thus:
Shell("cmd.exe c:\first.exe < in.txt > out.txt")
...Steve
|
|
|
|
|
well.. on double clicking the first.exe it opens its own editor (black wondow) where input is given and its output is displayed in the same window below the input lines of code.
the input can also be provided thru a file. i.e. type in the input text and savin it as in.txt and givin the followin command in cmd gives the desired output in the editor of first.exe file .
C:\> first < in.txt
to capture the output in a file. the followin cammnd works fine in cmd;
c:\>first < in.txt > out.txt
it creates the output file out.txt just fine..
i had wanted to do the same thing thru the Shell("c:\>first.exe < in.txt > out.txt") but it only opens the exe's editor but doesnt create the out.txt file,... the in.txt file has the input written and saved already...
i hope u got the clear picture.
may b i need to reprogram the first.exe file itself...
regards
shreeya
-- modified at 3:28 Thursday 29th September, 2005
|
|
|
|
|
If you're going to use the redirection operators in a command line, you MUST launch your command inside a command shell (CMD.EXE on NT-based machines).
Shell("cmd.exe /c c:\first.exe < in.txt > out.txt")
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks Dave, I missed the "/c" switch on the command.
...Steve
|
|
|
|
|
Dear dave..
thanx a lot.. your code worked..with a little modification
Shell("cmd.exe /c c:\first.exe < c:\in.txt > c:\out.txt")
thanx a zillion.
shreeya
|
|
|
|
|
I created a connection using OLE DB (ADO) to a password protected access database. I designed a report using Designer support. It is throwing error described as under:
Logon Failed.
Details: ADO Error Code: 0x80040e4d
Source: Microsoft JET Database Engine
Description: Not a valid password
SQL State: 3031
Native Error: -124782449
I am sure that I am not suppling password to report viewer. But I do not know the way.
And, Can I filter records at crystal report level?
Any Body Can Help Me.
Shoaib Nawaz
|
|
|
|
|
Sounds to me that the connection string to your access database is not in correct syntax.
Check it here http://www.connectionstrings.com
Cheers
|
|
|
|
|
To date have only written application with one form so do not laugh. Now I have a application with the need for more than one form.
I placed a button on the primary form to launch another form. The code I placed in click event is:
Dim frmTable as Form
frmTable.activate
But it tells me: " An unhandled exception of type 'System.NullReferenceException' occurred in Snow Loads.exe
Additional information: Object reference not set to an instance of an object."
I know this is a silly question but any help
|
|
|
|
|
Dim frmTable As New Form2
frmTable.Show()
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for reply
I tried
Dim frmTable As New Form2
frmTable.Show()
It did not like Form2
I tried
Dim frmTable As New Form
frmTable.Show()
This gave me the same error previously noted.
|
|
|
|
|
SoonerFan wrote:
I tried
Dim frmTable As New Form2
frmTable.Show()
What is the name of the form you are trying to instantiate? You need to change Form2 in the above code to whatever you have named it in your project (i.e. if it is called "TableForm" then the code becomes:
Dim frmTable As New TableForm
frmTable.Show() The second form must be defined in the same project as the form from which you are trying to display it.
Simply creating an instance of an undefined Form object will cause the error you are seeing.
You could also try this code since it is a better idea to separate the Dim and the New operations for reasons we won't get into here:
Dim frmTable As TableForm
frmTable = New TableForm
frmTable.Show()
...Steve
-- modified at 22:47 Wednesday 28th September, 2005
|
|
|
|
|
Steve Pullan wrote:
You could also try this code since it is a better idea to separate the Dim and the New operations for reasons we won't get into here:
Don't take this as bashing you or anything, I'm just curious what the reasoning behind this is. I've never seen anything that says it's a bad idea.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave, This entry from http://www.vb-helper.com/howto_test_dim_as_new_speed.html explains it better than I can, however I have been programming VB this way for ages for the same reasons. Granted that the efficiency gains are questionable especially with the fast processors of today, it is considered (by me) to be a good programming practice to separate the definition and instantiation/initialization of objects. I have not really investigated this with VB.NET and I'm prepared to be corrected if this is no longer the case. Thanks for asking.
From VB Helper:
When you declare a variable Dim X As New ..., Visual Basic doesn't actually initialize the variable until it uses it. Every time you refer to the variable Visual Basic needs to see if the variable has been initialized and initialize it if it hasn't. It essentially does something like this:
If X Is Nothing Then allocate X
Now do what the program says
The idea is Visual Basic cannot really know apriori whether the variable has been allocated yet.
If you declare the variable and initilize it separately, Visual Basic assumes you know what you're doing and that you will allocate the variable before you use it. If you don't, it raises an error.
...Steve
|
|
|
|
|
Hmmm...Didn't know that about VB6. Seems like a waste of processor time checking to see if the instance exists. Do that a couple hundred thousand times in a loop...
But, I don't think that's the case with VB.NET. I'd be willing to check into it later today.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I need help. I get a run time error that too many rows to output, based on limitation specified by the output format. I'm using VBA to export a Access table to Excel using below code:
DoCmd.OutputTo acOutputQuery, "EXPORT_LOUDAL_DC", acFormatXLS, "C:\MLE_Export\289 204 DC " + txtAddto + ".xls", 0
There are approx 18,000 rows. This code worked for months until the rows exceeded 16,000. Since Excel can handle 64,000 I'm not sure why the error.
Can any help. By the way... I'm a user not a programmer!
Thanks
|
|
|
|
|
It's not the number of rows, but the number of cells you're filling. Excel has it's limits, I don't know if/where they're documented, but you can't fill every cell of an Excel worksheet with a value, no matter how much memory you have in the machine. You've simply exceeded Excel's capacity.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
just wondering: is there anything that VB.NET can do that C# cannot? i noticed some of the Enterprise Library was written in C#, which is why i can't use it. which angers me, but i guess i'll just have to spend the $600 to...
anyway, back to the question.
is there anything one can do with VB that one can't do with C# or vice versa?
|
|
|
|