Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
GetSaveFileName
Hello everyone,
I am using the API GetSaveFileName and all seems to be fine except for when I press escape to cancel the dialog. I recieve a message that code processing has been interrupted and asked if I would like to debug or cancel. Anyone have any ideas what I can do to get around that? I am using the code from http://vbnet.mvps.org/index.html?cod...avedlghook.htm Public Function ShowSave(Title As String, InitialPath As String, InitialFilename As String) As String Dim sFilters As String Dim pos As Long Dim buff As String Dim sLongname As String Dim sShortname As String 'if first time through set the appropriate OFN size If OSV_VERSION_LENGTH = 0 Then Call SetOSVersion 'filters for the dialog sFilters = "Excel Files" & vbNullChar & "*.XLS" & vbNullChar & vbNullChar DialogCaption = Title With OFN .nStructSize = OSV_VERSION_LENGTH .hwndOwner = 0 .sFilter = sFilters .nFilterIndex = 2 .sFile = InitialFilename & Space$(1024) & vbNullChar & vbNullChar .nMaxFile = Len(.sFile) .sDefFileExt = "xls" & vbNullChar & vbNullChar .sFileTitle = vbNullChar & Space$(512) & vbNullChar & vbNullChar .nMaxTitle = Len(OFN.sFileTitle) .sInitialDir = InitialPath & vbNullChar & vbNullChar .sDialogTitle = "Blah Blah Blah" .flags = OFS_FILE_SAVE_FLAGS Or _ OFN_ENABLESIZING Or _ OFN_ENABLEHOOK .fnHook = FARPROC(AddressOf OFNHookProc) End With 'call the API If GetSaveFileName(OFN) Then buff = Trim$(Left$(OFN.sFile, Len(OFN.sFile) - 2)) ShowSave = Trim(buff) End If End Function Excel 2000-2003 TIA |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
GetSaveFileName across mixed language network | Excel Programming |