Pasting from the clipboard to the address box of inserthyperlink dialog window in vba

MS EXCEL

    Next

  • 1. Unprotect Sheet Password in Macros
    Hi: I have an Excel file that has been used as a template to create 800+ files that has the protection worksheet applied. I now what to add more formulas to this file and want to use a macro to do it. How can I enter the unprotect password automaticcaly as part of the macro and then protect the sheet again before saving and closing? Thanks
  • 2. loop through a column on a workbook copying data on each row to another workbook, then copy data back to the original workbook
    I have a need for sometype of loop control, I have a workbook where on column E and G i'd like to copy data to another workbook. The data in column E will be placed into a second workbook in cell B1, the value copied is then multiplied by 25.4. In column G of the first workbook I then copy it's value to the second workbook and place into cell B3, it is then multiplied by 1000. The second workbook I can then perform some calculations, which I've figured out already by macro, the value in cell B7 resulting from the calculations is then placed into column K on the first workbook, but on the same row I took the origianal data from. The macro would then continue looping through until no more records are present in column E. Can anyone help Regards burl_rfc
  • 3. Birthdays
    I keep details of my members at my skate park in a worksheet. Dates o birth are entered and then I am using the following formula t calculate ages: =DATEDIF(J252,NOW(),"y") & " years, " & DATEDIF(J252,NOW(),"ym") & months, " & DATEDIF(J252,NOW(),"md") & " days" so that my answer reads ? years ? months, ? days. What I would like to do is have 1.) a formula which calculates th average age and also 2.) one which can easily identify who's birthda it is on todays date or better still a formulae which identifie members who's birthday is due in 30 days time (so we can offer birthda party options 30 days in advance) Any help would be appreciated as I am now getting out of my depth. As a reward, if you are ever in Dubai, United Arab Emirates, come skat free! Thanks Chri
  • 4. Highlighting The Active Cell
    This is a Macro for 'Highlighting The Active Cell' that will change the background color of the ActiveCell to yellow anytime you select a new cell, either with the mouse or with the arrow keys. Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Excel.Range) Static OldRange As Range On Error Resume Next Target.Interior.ColorIndex = 6 ' yellow - change as needed OldRange.Interior.ColorIndex = xlColorIndexNone Set OldRange = Target End Sub The author says that if one wants to make the active cell appear in a special color, use the following this code in the Workbook_SheetSelectionChange event of the workbook. BUT, I am not good with VBA or Macros yet so I do not know what he means ... How do I get this Macro to work?

Pasting from the clipboard to the address box of inserthyperlink dialog window in vba

Postby Jay Fincannon » Wed, 06 Sep 2006 09:42:34 GMT

after 

Application.Dialogs(xlDialogInsertHyperlink).Show

what would be the next line of code to paste the contents of the clip
board into the Address field?

Jay

Re: Pasting from the clipboard to the address box of inserthyperlink dialog window in vba

Postby Tom Ogilvy » Wed, 06 Sep 2006 10:24:13 GMT

Application.Dialogs(xlDialogInsertHyperlink).Show

is equivalent to doing it with the menu, so You would probably need to use 
sendkeys before that command.  Code wouldn't run while it is displayed.


-- 
Regards,
Tom Ogilvy









Re: Pasting from the clipboard to the address box of inserthyperlink dialog window in vba

Postby Tom Ogilvy » Wed, 06 Sep 2006 10:28:17 GMT

My answer assumes you don't want to use the add method of the hyperlinks 
object for some reason. (you have no access to what is in the clipboard 
might be a reason and your unwilling to execute a paste to collect the 
information).

-- 
Regards,
Tom Ogilvy








Re: Pasting from the clipboard to the address box of inserthyperlink dialog window in vba

Postby Jay Fincannon » Thu, 07 Sep 2006 02:42:24 GMT

thank you Tom, here's is what i'm up to.
i'm going thru route books and establishing links to google maps for
each street.  is there a better way to do this.




On Mon, 4 Sep 2006 21:28:17 -0400, "Tom Ogilvy" < XXXX@XXXXX.COM >




Similar Threads:

1.How do I disable Office Clipboard so Copy Paste uses traditional Windows Clipboard

2.Windows File Dialog box problem from "Office 2000 VBA Fundamen

3.how to Disabling Printing Notification Dialog Boxes in Windows IN VBA

is possible....?

In effect with a mcaro for Excel i print 45 sheets present into wbook
and the printing dialogo box flashing for all 45 sheets....

4.Windows File Dialog box problem from "Office 2000 VBA Fundamentals

Good morning, all!
I'm, working my way through "Microsdoft Office 200 VBA Fundamentals" Chapter 
4, looking at displaying a "File Open" dialog box. The downloaded code works 
fine, in terms of returning a value when a filename is selected, except that 
when I press "Escape" whilst the box is open, at which point I get "Code 
Interruption has been interrupted", at the code marked with a #. Can anyone 
suggest what's happening. The equivalent code, to display a "browse for 
folder" works fine, and correctly clears the dialog box when escape is 
pressed.

--------------------FUNCTION--------------------------



Option Explicit

'-------------------------------------------------
' WinAPI Declarations
'-------------------------------------------------
Private Declare Function GetOpenFileName% _
    Lib "COMDLG32" _
    Alias "GetOpenFileNameA" ( _
        OPENFILENAME As OPENFILENAME _
    )
Private Declare Function GetSaveFileName _
    Lib "comdlg32.dll" _
    Alias "GetSaveFileNameA" ( _
        pOPENFILENAME As OPENFILENAME _
    ) As Long
Private Declare Function GetModuleHandle _
    Lib "Kernel32" _
    Alias "GetModuleHandleA" ( _
        ByVal lpModuleName As String _
    ) As Long
Private Declare Function GetActiveWindow _
    Lib "user32" ( _
    ) As Long

'-------------------------------------------------
' User-Defined Types
'-------------------------------------------------
Private Type OPENFILENAME
     lStructSize As Long
     hwndOwner As Long
     hInstance As Long
     lpstrFilter As String
     lpstrCustomFilter As Long
     nMaxCustFilter As Long
     nFilterIndex As Long
     lpstrFile As String
     nMaxFile As Long
     lpstrFileTitle As String
     nMaxFileTitle As Long
     lpstrInitialDir As String
     lpstrTitle As String
     Flags As Long
     nFileOffset As Integer
     nFileExtension As Integer
     lpstrDefExt As String
     lCustData As Long
     lpfnHook As Long
     lpTemplateName As Long
End Type
Public Type FileDialog
    Title As String
    CustomFilter As String
    DefaultExt As String
    InitialDir As String
End Type
 
'-------------------------------------------------
' Module-level Constants
'-------------------------------------------------
'used for GetOpenFileName API
Const OFN_READONLY = &H1
Const OFN_OVERWRITEPROMPT = &H2
Const OFN_HIDEREADONLY = &H4
Const OFN_NOCHANGEDIR = &H8
Const OFN_SHOWHELP = &H10
Const OFN_ENABLEHOOK = &H20
Const OFN_ENABLETEMPLATE = &H40
Const OFN_ENABLETEMPLATEHANDLE = &H80
Const OFN_NOVALIDATE = &H100
Const OFN_ALLOWMULTISELECT = &H200
Const OFN_EXTENSIONDIFFERENT = &H400
Const OFN_PATHMUSTEXIST = &H800
Const OFN_FILEMUSTEXIST = &H1000
Const OFN_CREATEPROMPT = &H2000
Const OFN_SHAREAWARE = &H4000
Const OFN_NOREADONLYRETURN = &H8000
Const OFN_NOTESTFILECREATE = &H10000
Const OFN_SHAREFALLTHROUGH = 2
Const OFN_SHARENOWARN = 1
Const OFN_SHAREWARN = 0

Function WinFileDialog(typOpenDialog As FileDialog, _
    iIndex As Integer) As String
    Dim OPENFILENAME As OPENFILENAME
    Dim Message$, FileName$, FilesDlgTitle
    Dim szCurDir$, iReturn As Integer
    Dim pathname As String, sAppName As String
    
    'Allocate string space for the returned strings.
    FileName$ = Chr$(0) & Space$(255) & Chr$(0)
    FilesDlgTitle = Chr$(0) & Space$(255) & Chr$(0)

    'Set up the data structure before you call the GetOpenFileName
    With OPENFILENAME
        .lStructSize = Len(OPENFILENAME)
        .hwndOwner = GetActiveWindow&
        .lpstrFilter = typOpenDialog.CustomFilter
        .nFilterIndex = 1
        .lpstrFile = FileName$
        .nMaxFile = Len(FileName$)
        .nMaxFileTitle = Len(typOpenDialog.Title)
        .lpstrTitle = typOpenDialog.Title
        .Flags = OFN_FILEMUSTEXIST Or _
            OFN_HIDEREADONLY
        .lpstrDefExt = typOpenDialog.DefaultExt
        .lpstrInitialDir = typOpenDialog.InitialDir
    End With
    
    If iIndex = 1 Then
        iReturn = GetOpenFileName(OPENFILENAME)
    Else
        iReturn = GetSaveFileName(OPENFILENAME)
#######
    End If
    If iReturn Then
        WinFileDialog = Left(OPENFILENAME.lpstrFile, 
InStr(OPENFILENAME.lpstrFile, Chr$(0)) - 1)
    End If
End Function

--------------------MACRO--------------------------

Sub GetFileWithSystemFileDialog()
    Dim sFileName As String
    Dim udtFileDialog As FileDialog
    With udtFileDialog
        '.CustomFilter = "Text Files (*.txt)" & Chr$(0) & "*.txt" & Chr$(0) 
& Chr$(0)
        .CustomFilter = "All Microsoft Office Excel Files (*.xls)" & Chr$(0) 
& "*.xls" & Chr$(0) & Chr$(0)
        '.DefaultExt = "*.txt"
        .DefaultExt = "*.xls"
        .Title = "Browse"
        .InitialDir = "C:\"
        sFileName = modFileDialog.WinFileDialog(udtFileDialog, 1)
    End With
    If Len(sFileName) > 0 Then
        Debug.Print sFileName
        MsgBox (sFileName)
    End If
End Sub


Thanks in advance for your assistance.

Pete

5.open InsertHyperlink dialog

I want to create a macro that opens the InsertHyperlink dialog
and enters a folder name that will be used to browse the folder.


6. Rich Text Box Control and Pasting the Clipboard

7. Paste Hyperlink into Frontpage Dialog Box

8. Disable Clipboard Dialog Box during Macro



Return to MS EXCEL

 

Who is online

Users browsing this forum: No registered users and 11 guest