Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic


Hi all

I have noticed lots of people using the following function


I do not have access to these VB6 functions. What am I missing?



View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
I have this code where I use the Win Save File AS dialog.
If I press OK in this dialog it works OK., but if I click Cancel to NOT save the file, then it goes into error.
Any ideas how I fix it?
Thanks in adv.

Sheets(Array("Rapport2", "BOMA", "Rapport3")).Copy

Dim strFilt As String, strFileName As String, strSaveAs As String
strFilt = "Microsoft Excel File (*.xls),*.xls"
strFileName = ThisWorkbook.Sheets("Rapport2").Cells(2, 11).Value
strSaveAs = Application.GetSaveAsFilename(strFileName, strFilt)
ActiveWorkbook.SaveAs Filename:=strFileName & ".xls", FileFormat _
:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, CreateBackup:=False

At the end of my code I want to force the user to save it as something else. I don't care where or what the name is, as long as the format is as an Excel Workbook. I put in:


and that successfully calls up the dialog box to save, but does not force it to be an Excel Workbook. I played around with different guesses, but couldn't come up with anything.


ps, I tried a search for GetSaveAsFilename on this board and didn't find anything and a search for "Save As" ignores the "As" and comes up with anything and everything. Any better search tips would be appreciated.

Isn't there a function to open a dialog box which allows the user to select where they want a file to be saved? For instance I have a file that is located say on J-Drive...I want to take this file and store it to where the user wants to store it..allowing them to choose.


GetSaveAsFilename Questions

I have three questions about the GetSaveAsFilename Application: 1) Is there a way to set it to default to the "My Documents directory and 2) Is there a way to clear the current file name so user is not tempted to just add a number or letter.

3) My code then saves the result of the GetSaveAsFilename, adding the .xls "manually" so Excel will see the file if someone wants to open it from Excel with thefollowing code:

ThisWorkbook.SaveAs NewFileName & "xls", FileFormat:=xlNormal,_ ReadOnlyRecommended:=False

But then if it is run again, I get a file named ****.xlsxls. This is not good. How can I add the xls once and only once?


Excel Macro GetSaveAsFileName
Hello. I have an excel macro I've written, and now I'm just trying to clean it up a little. The first thing the macro does is ask the user to save the file with:

Application.GetSaveAsFilename("", _
fileFilter:="Excel Files (*.xls), *.xls")

If cancel is hit from the dialog box, the macro ends, which is good. If the user selects a file name that already exists the office assistant pops up and asks if the user wants to overwrite the existing file. If yes is hit everything continues with no problem, but if no or cancel is hit, the macro goes into the debug phase and stops. What code do I need to handle the office assistants buttons?

I've used the Resonse=....,vbYesNo feature in the macro, and I know how to handle those message. I'm guessing there is something similar for the office assistant, or do i need to turn him off and generate the message myself to handle the user's response(in which case I thought about this, and I don't know how I would detect an existing file on my own).

Any help here would be greatly appreciated. thanks!!


How To Handle Size && Position Of Console Application With Windows Application In VB6
Hi Dear All,

I am facing a major problem in VB6. I wants to create an application in VB6 which contains one OLE control and one Picture box. OLE control contains the Word Document and in Picture box a DOS based application which is already developed should show. I am using shell function to call the DOS application but unable to set its Size and Position. So please help me to solve this problem. I have already used some of the API's like ShowWindowPos(), MoveWindow(), DeferWindowPos() but thease function works only for Windows based exe not for DOS based exe. Please tell me the way to solve the problem.

OR If somebody tell me how to convert a DOS based exe program into Window based exe program so that I can call DOS Application as a Window based application.

So please help me asap.

Deependra Pathak

How Can I Code My Application To Successfully Hide My Application's Proccess Usage?
How can I code my application to successfully hide my application's proccess usage from NT's Task Manager's Proccess listing and Window 98/ME's Microsoft System Information>Running Tasks listing?

The second feat I would love to code is to successfully hide my application from Window's MSconfig utility.

What say you?

Application Wont Run Because Application Needs Newer Version Of A DLL File
I have created a small little install screen in VB6 that will launch the installation of the program I created.
This small screen is set to run from the CD-ROM when the CD is inserted into the CD-ROM drive(autorun).

I have put all of the necessary VB runtime files on the CD-ROM so the application will run right in the app.path of the EXE of the install screen.

Here is the problem when testing the screen it works fine from some computers and comes up nicely like it is supposed to do. However on some older opperatining systems such as Windows 95B I get an error that says : This file requires a newer version of DLL(usually oleaut32.dll), however the file it requires is right in the app.path on the CD-ROM?

It seems to be searching the C:WindowsSystem directory first before searching the app.path. And when it encounters an older version it displays an error and refuses to show the install screen.

The only thing I could come up with in the short term is to include the new version of VB Runtime files for the user to install first. What I want to know is there any way to force the program to search the app.path first so it wont generate this error? Or is there any other way to get this install screen to run on all computers with older operating systems without installing the new VB runtime files to the users Hard Drive?

Any suggestions anyone can give me would be most appreciated

Application.visible Still Flashing Word Application
Hi All

This is my first post to one of the most impressive looking newsgroup forums I've seen.

I've created a VB .dll that creates and uses merge templates and then converts it to PDF format. However the client requires that the End User is not aware that Word is involved in the process and wants me to hide Word while the merge is happening.

I've tried both Application.visible = false and Application.WindowState = wdWindowStateMinimize, but Word still flashes up - albeit for a short time and the focus is lost from the Client's application.

Please could anyone advise what I've overlooked. (I have had very little VB or Office automation experience to date - but we've all got to start somewhere!)

My function is included below. Any comments about how I can improve my coding techniques would also be welcome.


Public Function fMSWORDMerge( _
ByVal pWordTemplate As String, _
ByVal pDataFile As String, _
ByVal pSaveFileAs As String, _
ByVal pPrintOption As String, _
ByRef pErrorMsg As String) As Boolean

Dim oWordApp As Object
Dim oDocument As Object
Dim bOK As Boolean
Dim bSavePropertiesPrompt As Boolean

On Error GoTo ErrHandler

bOK = fOpenWordApp(oWordApp, pErrorMsg)
If Not bOK Then
GoTo ErrHandler
End If

bSavePropertiesPrompt = oWordApp.Options.SavePropertiesPrompt

With oWordApp
.WindowState = wdWindowStateMinimize
.Options.SavePropertiesPrompt = False
.Visible = False
.Documents.Add Template:=pWordTemplate, NewTemplate:=False, DocumentType:=wdNewBlankDocument
With .ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=False
End With
.ActiveDocument.SaveAs FileName:=pSaveFileAs, AddToRecentFiles:=False
End With

If UCase(pPrintOption) = "PRINT" Then
ElseIf UCase(pPrintOption) = "PDF" Then
PrintToPDFActiveX oWordApp.ActiveDocument, pErrorMsg
End If

oWordApp.Documents.Close SaveChanges:=wdDoNotSaveChanges
oWordApp.Options.SavePropertiesPrompt = bSavePropertiesPrompt

oWordApp.NormalTemplate.Saved = True

Exit Function

For Each oDocument In oWordApp.Documents
oDocument.Close SaveChanges:=wdDoNotSaveChanges
Next oDocument
End Function

How To Make Sure Application Waits For Another Application To Finish
I'm sure this is not the first time this question has been asked.

My VB application needs to execute another application using the Shell command. The other application will manipulate some data and it could be a little time comsuming and it is imperative that my VB does not continue on until the other application has finished processing the data.

How do I do this?

How To Open An Application And Send Value To The Application Variable...?
I use the following coding to call out another application from current application, but I don't know how to send some value to new opened application...?

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long

Private Sub CmdOpen_Click()
On Error GoTo Err1:

Dim MyAppID, ReturnValue
ReturnValue = Shell("C:Program FilesMCSSMCSS.exe", 1)
AppActivate ReturnValue

End Sub

Call A Make My Application Run A Sub Routine, From Another Application?
hey guys,

how can i make my application run a sub routine, from another external application?


Say i have two EXE's

1) MainApp.exe
2) Settings.exe

When / If I change & save any settings in Settings.exe, how can i make MainApp.exe re-call a sub (IE: LoadSettings()) to get the new settings from an ini file?

is it possible?

Thanks guys.

How To Embed An Application In The OLE Control? (The Application Is Not EXCEL),thanks
How to embed an application in the OLE control? (The application is not EXCEL or Clipboard),thanks

Running A VB Application From MS Office Application Menu
Is there a way of adding a custom button to the main menu of a MS Office product (eg Outlook, Word etc) which when pressed will activate my VB6 application?

I have read about creating an app as a COM add-in but was hoping there is a simple way.



When you call out for help in the darkness, and you hear a voice in return, you're probably just talking to yourself again!

How To Get Handle Of Active Control Of Any Application From My Application
how can i get the handle of any active control (edit control) of any other programe from my programe. i.e. if nodepad is running, i start my application, and set focus to notepad, my application shows the handle of the edit control of notepad.

Containing Text/data From C/c++ Dos Application In Vb Application...
I'm building a console in VB and need to know if there is a way to execute an application using Shell(), maybe hiding the application, and then put the data into the console window, like DOS, only in VB. Any help on this would be appreciated...

Minimize Application When Other Application Running..
I use shellexecute to run another program but I want my vb application minimized when I click the cmdbutton. How can I do that?

How To Make A Setup Application Like Known Application?
How can I make with a short time a Setup application like known application?

Start My Application When Other Application Gets Started
Hello, is there a way to start my application as soon as another application (for example Notepad.exe) gets started ?

I'd like to do this without constantly running another application with a timer in the background, to check the running processes every few seconds.

VB Application Calling A JAVA Application

Basically I know virtually nothing about VB, however I have been assigned a task to update an existing VB application.

What i need to do is have a button on this VB application somehow get a small JAVA application (which basically is just a window which displays a web page) i have created to run. The two applications do not share any data or anything like that. I merely need the VB to get the JAVA to run when the VB Button is pressed.

How difficult is this? I was hoping I dont need to use any bridging using ActiveX etc... is this possible?

Any code solutions would also be greatly appreciated, thanks.

Application Popup: Vb6 Exe - Application Error :
Application popup: vb6.exe - Application Error : The instruction at

"0x0043f08f" referenced memory at "0x608af85c". The memory could not be


It started after I installed the VS.NET.

Then I uninstalled .NET, didn't work

Then I cleaned my computer from VS 6.0, deleting everything from

registry too

did a clean installation, vain.

Please help me with this...

Its only happening when I m closing the VB

System Config


VS 6. Sp 6

checked for all known viruses

Done a clean update of VS 6.0, but in vain

PLZ Help Me! How To Make My Application Look Like A Windows XP Application

I am developing an application in VB 6. And the application is looking similar in Win 98, Win 2K and also in Win XP. What I mean is that, I want my application to look like a Windows XP application. For example; The buttons in Windows XP will has a better look than the buttons in Win 2K. But my application is looking the same in XP as well as in Win 2k. I am attaching 2 pictures so that I may explain it a little clearly. If you have looked the attachment, there's a lot of difference in the look. So how to make my application look like an XP application. Thank you, but I didnt know how it explain it....


Edited by - sri1025 on 8/23/2005 1:43:06 AM

How To Terminate A Running Application From Another Application?
I want to close a application
from another applicatioon so plz help me
Expecting the level is beginner


Windows Distributed Application And Web Application
I have developed a .net window application using a database connection string to access a network SQL server database. Now I was told that the front end window application will be installed on a doctor's home at California, and the SQL server is on a window 2000 server at New Jersay behind a firewall. The database connection string using a IP address doesn't work any more. What should I do to make it work again? I know I can use web services as middle tier to access the database and provide to the front end, and I don't want to do it that way because of complexity. I just want to find a quit and easy solution. Thanks

Can I Execute The Code Of VB Application From Another Application???
I have some difficult i need to run the following code of TabStrip in VB outside that application(VC++ or VB).

TabStrip1.SelectedItem = TabStrip1.Tabs.Item(1)

This code just selects the second tab in Form Load of VB Application.I tried to use SendMessage With Handle and TCM_SETCURSEL Msgs But it does not work if that application is invisible.

So any ideas Gurus.

Thanks in Advance


Convert Access Application To Vb Application
how can i convert an access97 application to a vb6 application?

Telnet Server, RF Client Bar Code Reader, Working With A VB Application Thin Client Application
> Hello To All,
> I need a little advice and direction.
> I trying to build and application where a RF (Radio Frequency 900mhz
> hand held Bar Code Reader) device would connect and enter and retrieve
> information from a VB application.
> Example of Screen:
> Updating Inventory:
> Invoice Number:_____________
> Part Number: _____________
> Quantity: _____________
> Press F2 to Save and Continue.
> How Do you build a Telnet or VT100 or VT220 Server application in VB
> that can create the Example and except the individual entries.
> The hand held device can connect to a server in Telnet (ANSI), but I
> just lost and can find anything solid on the web.
> Steven

Close Application Using Timer Or Unattach Serial Port In Application Using Timer
Hello. I'm thinking to limit my application usage to certain hours. I'm doing a vehicle's license plate recognition to trace cars that enter an area during office hours. I'm using a IR signal sensor that will detect the incoming and outgoing cars. The IR device is connected to serial port. So i want my application to start on 8 a.m and end at 5 p.m , that is the working hour in my place. So i think i should write the program according to the clock in the system. I think i can do 2 things :
1) disconnect the serial port connection from my application. So when sensor is disconnect, no car will be detected.
2) shutdown the application.

Do any of you have suggestion on how to do it? Thanx.

Converting VB 6 Application To Web Application
Where can I find instructions to convert a VB program I wrote to be run as a web page on our Intranet? Thanks in advance!

Refreshing COM+ Application From VB Application

I use COM+ applications on the server side (COM+ server).

When I need to refresh the COM + application, I access it by Start  Programs  Administrative Tools  Component Services. I select the required com+ application I need, right click on it and say ‘Refresh’ to refresh the COM+ application.

I need to do the same from within a VB application.
I can access the COM+ application form my VB application with the code like below:

Dim objDataIO As abc.clsDataIO

Set objDataIO = CreateObject("abc.clsDataIO", SERV10) method method etc.

In the same way, I need to be able to do a refresh of the COM+ application, like I do it manually as I described above. Is there a way? What is the syntax?

Thanks in advance for the help

Refreshing COM+ Application From VB Application

I use COM+ applications on the server side (COM+ server).

When I need to refresh the COM + application, I access it by Start  Programs  Administrative Tools  Component Services. I select the required com+ application I need, right click on it and say ‘Refresh’ to refresh the COM+ application.

I need to do the same from within a VB application.
I can access the COM+ application form my VB application with the code like below:

Dim objDataIO As abc.clsDataIO

Set objDataIO = CreateObject("abc.clsDataIO", SERV10) method method etc.

In the same way, I need to be able to do a refresh of the COM+ application, like I do it manually as I described above. Is there a way? What is the syntax?

Thanks in advance for the help

How Can I Separate My Application To 4~5 Sub Application ?
Hello everyone...

I had developed my application with VB6.0.
and EXE size is over 50MB.

But happend memory shortage.

So I want to separate my application to 4~5 sub application.

So by callig MDI menu, executing sub-application.
(like Child window..)

How can I do ?

Fire Application From Within Application?
Anyone know how I can fire up another VB App from with in another?


Other Application Inside Own Application
Hi Peeps! To all gurus out there and newbies like me, this is for you. I just want to know how can I put other application inside my own application. Let's say the calculator. I want to call this piece of application and place it inside my own MDI form. I certainly have no idea of how to do this but I need to since it is being asked.


Conversion Of VB 3 Application To VB 6.0 Application
Hi friends this is the email regarding a help while converting a VB 3 application to VB 6.0
My Question is :
I have successfully converted the application but the application made by previous Programmer contains Picture boxes on the forms instead of textbox, Datagrid, Button, etc but on running the setup this Picture box looks like the respective control,
Now i m facing an error "Method or data Member not found" Since i said
my form contains Picture boxes there are several properties accessed which are not belonging to picture box but still are working as button, textbox, etc. i found and error in
this line saying ColFieldLen method or data member not found
What could be the possibilty ??
According to me..
There must be some Custom Active X control create by the developer and the .dll file or .ocx file is missing in my system.
Is it possible that picturebox class inherits textbox properties , button properties

Picture box is used as container and controls are placed on it..
Please do give your feedback ASAP.. i m need

Calling A C# Application From A Vb6 Application
I have a vb6 application with some menu items.  When the user hits "Graph" menu item I would like to call a small C#.Net application I have created.  Does anyone know how to do this?  Thanks for all your help.

Open Other Application Application ?

How to open other applications file from VB.

For eg : install.doc file is there. I want to open this file from VB in MS- WORD.

How to do this ?

Can any one tell me ?

Suresh S

Closed Application From My VB Application
Hello Guys,

I want to close an application from my VB6 application.. particularly internet explorer.. i have read the FAQ on closing application, tried the sample code and is perfectly fine.. still, user have to select what application to close.. is it possible to tag let say C:programfilesinternetexplorer.exe and close? thanks a lot!


[VB] Start A Application From Another Application On NT
Hello All,

I am trying to find call other then ShellExecute() that opens and runs applications on an NT box. Any suggestions.


How To Execute One Different Application Into Another Application.
I have one of my Visual Basic application and I have one more application , I want to try to load the new application in my current one and try to execute it and the new application after executing, should return the control back to the main application, how do I do this??


VB Application As A Console Application
I have an existing VB application I have written that I would like to add the option to run the application using command line parameters and without opening the form. Is there a way to do this in VB?


How To Export/use A Vb5 Application On A Web Application
I recently received a VB5 program (Exe). I would like to build its online version in order to use it directly from my web site.

Can I export the Exe project as it to an activeX project and load it into an web page ?
or must i code it from start ?

My web server is IIS 5
My server is Windows 2000
I have visual basic 6 ans visual

Thanks a lot.

What's The Difference Between Client Based Application And Web Based Application?
what's the difference between client based application and web based application? and which one is more secure?

What Is Application Global Class And Application Local Class?
I read about above two classes in MSDN. But I cann't understand completely the differences between two of them.

My word is very short ? isn't it?

But I don't know the differences between two of them absolutely.

Any kind explanation about the two of them will make me happy a little.

Thank you For reading my letters

How To Run A DOS Application In VB Application Without Display The Window's DOS Shell Window?

I want to run a DOS application from my VB application.

My question is how to run a DOS application in VB application without display DOS prompt window.

Clearing Memory Usage Of My Application | Getting Memory Usage Of My Application

I just looking at applications mem usage, on my Task Manager,

And noticed, all of the programs memory usage rises, as their are in use longer,

So, i was wondering,

Since unloading the app, clears the usage, etc (When done properly)

Is there a way to clear the usage (of old data) whilst its in use,
Its mainly browsers that keep the MEGA usage (IE does too, but thats another point),

So jst wondering

Or, How do i Get the memory usage of my application?

If my app reaches something like 50, 000 KB (Leave it on for like 4/5 hours at a time, and that)
I will make a "subRoutine" to re-load the application (since it normally fix's memory loss etc)


TOP Of All Application
I want to make my Form at the Top of every Application.
How can i do this

Thanks in Advance

My First VB Application
Ok guys be easy with a beginner

This is my first setup for a VB application and I have some difficulties...

First, I've used Install shield to create the setup, so all DLL should be included, BUT, when some user launch my software, it gives me the error 429, ActiveX can't create the object. What I'm I doing wrong?

Thanks guys!

Need Help On SMS Application

I have a little problem regarding my SMS application using MSCOMM control. This is the situation :

During the incomming text message arrive my program will intercept it (what I did to intercept the txt, is putting a timer and issue a AT commands inside the timer). Now, what i want to happen, I want it that the program will automatically response / send a text message after the message has been receive. This is what I did :

After the txt message arrived, I issued a AT command to send a message, but it wont work. I think, there's been a conflict AT command on my timer and the AT command when sending.

I've alredy tried, disabled the timer at runtime during sending the message, but still it won't work.

But, it work when I disabled the timer at designtime, but the problem is that, I cannot intercept the incomming message.

Could somebody had any idea on how to solve this problem?

Thanks a lot.


Copyright © 2005-08, All rights reserved