|
The values from the app are being passed in the correct manner , It works fine if imported to a txt file. How do i overrule the excel cell formatting
|
|
|
|
|
I want to turn off / on my screen using vb 6.0. Can any body help me out? How to do it?
Kiran Sajanikar
Pune.
|
|
|
|
|
If you consider that Windows has the ability to hibernate your computer and monitor, then you could implement the same API call in your application.
I have no idea what this API function is called or what DLL it comes from, but try searching for it on google.
Daniel Minnaar
Lead Software Developer
|
|
|
|
|
I'd provide you with a link to the Windows Power Management API's reference, but MSDN has been just about non-existant for the last 2 days.
This is about the best anyone can do right now. You're looking for the second link down in this[^] search result.
|
|
|
|
|
I have some modules. And i add them into my project. I want to use some functions in them. How can i call any functions which i want?
|
|
|
|
|
Generally by creating an instance of the class in the module that impliments them
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
If your module functions are static (or Shared) in VB, just call the name of the class and execute the function.
If not, then create the instance of the object using the New keyword. ( Dim myObj As New ModuleObject() )
Daniel Minnaar
Lead Software Developer
|
|
|
|
|
Ok, i have an excel report with two columns. I would like to build a program that searches for the value in the first column, returns the value in the second column next to the value searched. At the same time, I would like the value of the first and second column recorded into a .txt file and saved to a place of my choosing. I don't need to update the excel file, it's just a reference. Basically, search for x, return y (which is right next to x), and add up the values of all y1...2...3 and save to this report. Is this possible with a macro, and if not, can anyone suggest where to start with a VB program, as I haven't worked in VB in 6 years. I am working with Visual Basic Express 2008. Any help is supremely appreciated.
|
|
|
|
|
This can be done entirely in VBA inside Excel. You may want to start by reading up on the LOOKUP functions in Excel. They'll handle the searching for values and returning the value in the next column.
After that, lookup the File I/O functions in VBA, Open, Print, Close, ...
|
|
|
|
|
Hi
i want to use an dll that have def file on vc++ and lib file that i cannot use it directly in vb in refrence , please help me to use it in VB in other ways.
i can send you the files if you needed.
Thank you for attentions
Best regards
|
|
|
|
|
If the .DLL is COM-based, then you can set a reference to it. Since you can't, you have to manually write Declare statements that import the functions from your .DLL. This is called "P/Invoke". An example of this would be:
Private Declare Auto Function ShellAbout Lib "shell32.dll" ( _
ByVal hWnd As IntPtr, ByVal szApp As String, _
ByVal szOtherStuff As String, ByVal hIcon As IntPtr) _
As Integer
What you put in this statement depends on the functions you want to import and the parameters those functions take.
You can read up more about it here[^].
The .lib file is useless to you in VB.NET.
|
|
|
|
|
Hi,
As part of a short-term project to speed up a clients model, I have taken a financal model written in VBA and put it into VB, which I've compiled. However, the compiled VB model runs a little slower than the VBA. I had expected to get some speed gains, but not to have something that runs more slowly!
Does anyone have any idea why this might be the case or pointers on how I might identify the problems? Searching on Google and Microsoft haven't thrown up any answers.
Thanks,
John.
|
|
|
|
|
There's no way to tell without knowing anything about your code, what it's doing, where the slowdown is, ...
Overall, the compiled VB6 executable should be faster than VBA, but that depends on a lot of things...
|
|
|
|
|
Hi Dave,
The code is a large financial model. It uses multiple classes and reads/writes to SQL server 2000 DB at the start and end.
In short, the vast majority of the code is math operations - mostly fairly simple ones. There are also quite a lot of arrays which are read/written to. Both models use the same range of COM objects for further functionality.
Can you outline some of the more common issues resulting in slower compiled VB6 code?
Many thanks,
John.
Dave Kreskowiak wrote: There's no way to tell without knowing anything about your code, what it's doing, where the slowdown is, ...
Overall, the compiled VB6 executable should be faster than VBA, but that depends on a lot of things...
|
|
|
|
|
jgrogan wrote: Can you outline some of the more common issues resulting in slower compiled VB6 code?
You mean some of the millions of possibilities??
Seriously, it comes down to the quality of the code and exactly what it's doing. You also might have too much in the way of expectations on how fast the code should run compared to the VBA version. You might get 25% out of the VB6 version, if you're lucky. There are sections that will run faster, but this is limited to stuff that does NOT include database access, math operations, and COM objects, interprocess communication, among others. VBA isn't interpreted as much as you may think. It still gets compiled, but on a method by method basis when it's needed.
|
|
|
|
|
Unless specific server takes to defaul the Windows registry?
Fulvio
|
|
|
|
|
Your question still doesn't make any sense at all. You might want to have someone else convert your Italian question into English so we can understand it.
|
|
|
|
|
If i don't put the server name in smtp.server
take the default server of user ???
|
|
|
|
|
There is no "default server". If you don't tell it the SMTP server to use, your message doesn't get sent.
|
|
|
|
|
Member 1996543 wrote: take the default server of user
No. Rather the CLR would resort to its default behavior when something goes wrong. That is:
"Throwing an exception to the user ".
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Hi,
I have a small problem with folder deletion from a VB application.
It's a bit long, so bare with me.
I have a form that upon its initialization a folder is created using MkDir.
When the form unloads, in its Terminate event the folder is being deleted using RmDir.
in between, temporary files are written in to the folder, and deleted from it.
My problematic scenario is this:
1. the folder is created.
2. files are written.
3. files are deleted.
and here is where the problem starts:
on one computer (debug computer), the RmDir throws an exception of access denied, because a process is locking the folder, but I ignore this error, and when I load the form again, I ignore the error the MkDir throws, and everything seems to work fine (except for the fact that the folder isn't deleted).
on another computer (which also happens to be the QA, and thus really important), again the folder is not deleted (I don't know if there is an error or not - can't debug), but it is also not accessible anymore. Since it is not accessible, when I re-load the form and try to create the folder again, I get an error. The folder is in limbo. when i close the application (and its process dies) the folder is deleted.
my two main goals are
a) figure out why the computers are behaving differently
b) figure out a way to find out what locks the folder, and release the lock.
The only workaround we found, was not to create the same folder each time , but that requires a lot of code changes to VB code as well as C code, as well as not prevent accumulation of temporary folders in my system, both of which I would like to avoid.
Any help would be amazing.
Thanks.
P.S. - in case it was not clear - this is VB6 code.
|
|
|
|
|
soporificeffect wrote: the RmDir throws an exception of access denied, because a process is locking the folder, but I ignore this error
Do you have a command prompt open or a DOS-based app running with this folder as the current directory?? A Windows process cannot "lock" the folder itself, only the files in it. If there is a file in that folder that is open, you cannot remove the folder that contains it, be it a DOS or Windows process.
Is the folder empty when you try and RmDir it?? There can be no files in it when you do this.
Do you have a virus scanner running, indexing service, or something else going on "behind the scenes"?? Disable it and try your app again.
modified on Tuesday, December 04, 2007 2:11:25 PM
|
|
|
|
|
I delete all the files before I try to remove the folder. the folder is empty.
there are no applications using this folder.
I'm not sure what services run in the background, but it is not possible to disable them.
All this also does not explain how on the second computer the folder ends up in "Limbo", I can see it in the windows explorer, but I can't access it, it's as if the RmDir hasn't finished running, because the second the app closes the folder is gone
|
|
|
|
|
Is there a way to verify what the "Date Modified" date is for a document in Windows? I want to import a report, but I don't want to import it if it bombed overnight so I want to make sure the Date Modified is today's date. Any ideas?
|
|
|
|
|
You can try using the DateLastModified property of the File object(FileSystemObject).
|
|
|
|