Re: dll declaration without path?
Try putting the DLL in the System Directory ?
Re: XP Style Controls
Hello my good friend Jack
Yes, I have been busy on a personal level with things @ home.
Always good to come to ozgrid.
Re: dll declaration without path?
If you do not specify a path for libname, Visual Basic will search for the file in the following order:
1. Directory containing the .exe file
2. Current directory
3. Windows 32-bit system directory \Windows\System32
4. Windows directory \Windows
5. Path environment variable
So what you need to do is have your Dll registered in one of the above locations.
Re: XP Style Controls
email me what you have and what you have done.
I'll need to make it easier for everyone.
I'll try and get back to you as soon as I can....
Re: Show Print Dialog Box
Try this code:
Re: Internet Connection
try something like this;Code
Option Explicit Public Declare Function InternetAutodial _ Lib "wininet.dll" ( _ ByVal dwFlags As Long, _ ByVal dwReserved As Long) _ As Long Public Declare Function InternetAutodialHangup _ Lib "wininet" ( _ ByVal dwReserved As Long) _ As Long Private Declare Function InternetAttemptConnect _ Lib "wininet.dll" ( _ ByVal dwReserved As Long) _ As Long Public Const INTERNET_AUTODIAL_FORCE_ONLINE = 1 Public Const INTERNET_AUTODIAL_FORCE_UNATTENDED = 2 Sub TestConnection() If InternetAttemptConnect(ByVal 0&) = 0 Then MsgBox "You can connect to the Internet", vbInformation Else MsgBox "You cannot connect to the Internet", vbInformation End If End Sub Function PopUpConnectDialog() On Error Resume Next If InternetAutodial(INTERNET_AUTODIAL_FORCE_ONLINE, 0) Then MsgBox "You're still Connected!", vbOKOnly, "Internet connection Status" End If End Function Sub PopUpThenDialConnectDialog() On Error Resume Next If InternetAutodial(INTERNET_AUTODIAL_FORCE_UNATTENDED, 0) Then MsgBox "You're already Connected!", vbOKOnly End If End Sub Sub HangUpConnection() On Error Resume Next If InternetAutodialHangup(&O0) Then MsgBox "You're Disconnected!", vbOKOnly, "Your App Name" End If End Sub
Re: get network path name of active workbook
To get the UNC path given it's letter or Drive then this function may help
Just pass it the Drive letterCode
Option Explicit '// 32-bit Function version. '// Note: Declare Function WNetGetConnection32 _ Lib "mpr.dll" _ Alias "WNetGetConnectionA" ( _ ByVal lpszLocalName As String, _ ByVal lpszRemoteName As String, _ lSize As Long) _ As Long '// 32-bit declarations: Dim lpszRemoteName As String Dim lSize As Long '// Use for the return value of WNetGetConnection() API. Const NO_ERROR As Long = 0 '// The size used for the string buffer. Adjust this if you '// need a larger buffer. Const lBUFFER_SIZE As Long = 1052 Function fnUNCPath(strDriveLetter As String) As String '// Takes specified Local Drive Letter '// eg E,D,H Etc and converts to UNC Dim cbRemoteName As Long Dim lStatus As Long '// Add a colon to the drive letter entered. strDriveLetter = Left(strDriveLetter, 1) & ":" '// Specifies the size in charaters of the buffer. cbRemoteName = lBUFFER_SIZE '// Prepare a string variable by padding spaces. lpszRemoteName = lpszRemoteName & Space(lBUFFER_SIZE) '// Return the UNC path (eg.\\Server\Share). lStatus = WNetGetConnection32( _ strDriveLetter, _ lpszRemoteName, _ cbRemoteName) '// Has WNetGetConnection() succeeded. '// WNetGetConnection()returns 0 (NO_ERROR) '// if it succesfully retrieves the UNC path. If lStatus = NO_ERROR Then '// Get UNC path. fnUNCPath = lpszRemoteName Else '// Unable to obtain the UNC path. fnUNCPath = "NO UNC path" End If End Function
Re: Splash Screen Load
in your code for the userform
When Userform finishes reset back
For examples of this .. have a look here
Re: Closing a WorkBook
just after pasting your data and before closing the workbook
Re: Regd:VB_procData.VB_Invoke_funcQuote from gowrishankarms
Thanks for your reply..
Can u please tell me settings that is needed so that my code too has
Thanks in advance
Not sure I understand ??
Your code DOES have this in, it's just that it will not show it in the VBA Editor.
It is picked up by the compiler and really only used for Shortcut key assignment and discription.
Re: evil code... go awayQuote from Neiluk66
You should be able to select the "break Link" option in the Links menu you are accessing. This should do it.
That option is not avail for Xl2000
You will need to fins the formula that references the other book or possibly a macro link assigned to a button ??
Re: read %temp% directory
Re: Writing a Macro to complete Autofill functions
This worked for me with out being in the Activesheet.Code
Sub Macro1() ' ' Macro1 Macro ' Macro recorded 20/05/2005 by Scott Bruce ' ' Keyboard Shortcut: Ctrl+t Dim ShCalc As Worksheet Dim ShVar As Worksheet Dim lRowCount As Long Set ShCalc = Sheet1 ' = Sheets("Calculations") Set ShVar = Sheet2 ' = Sheets("Independent variables") lRowCount = ShVar.Range("D65536").End(xlUp).Row - 13 If lRowCount = 0 Then Exit Sub ShCalc.Range("C10:I10").AutoFill Destination:=Range("C10:I" & 10 + lRowCount), Type:=xlFillDefault Set ShCalc = Nothing Set ShVar = Nothing End Sub
Re: Undo function unavailableQuote from Stephan001
Uninstalling a freeby Add-on called Navigator (http://www.robbo.com.au/)which I've used on and off occasionally in the past (very usefull when trying to find links in large workbooks) has "solved" the UNDO problem. Not sure what caused it so if anyone has a suggestion please let me know.
probably due to the Addin having a Global Event ... ie Events that monitor some action.
Re: Global Workbook/sheet referance
You could set a reference to the project workbook.
While in VBA Editor...... Activate your workbook.
Tools > References
Look for your Project name (In fact you should really rename your reference workbook other wise you will get name errors)
Click on the project name. (just like setting a reference to any other obj library file eg Word etc)
Now just refrence the name of the project eg