LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Using 32 bit VBA in Excel 2007



I made the rash assumption that the 32 bit call was the problem. My project
is generating a sheet of 24 photo thumbnails along with their "name" on a
worksheet. All photos are stored in files grouped in 24. The eventual print
sheet is then placed in a hard copy folder which allows for quick retrieval.
Has worked like a charm for 8-9 years. I "stepped" the code and it appears
to locate the first entry point on the worksheet, but does not insert the
photo. It then stops. The code(s) are listed below:
This code is from J Walks PUP:
Function GetDirectory(Optional Msg) As String
Dim bInfo As BROWSEINFO
Dim path As String
Dim r As Long, x As Long, pos As Integer

' Root folder = Desktop
bInfo.pidlRoot = 0&

' Title in the dialog
If IsMissing(Msg) Then
bInfo.lpszTitle = "Select a folder."
Else
bInfo.lpszTitle = Msg
End If

' Type of directory to return
bInfo.ulFlags = &H1

' Display the dialog
x = SHBrowseForFolder(bInfo)

' Parse the result
path = Space$(512)
r = SHGetPathFromIDList(ByVal x, ByVal path)
If r Then
pos = InStr(path, Chr$(0))
GetDirectory = Left(path, pos - 1)
Else
GetDirectory = ""
End If
End Function


' Macro recorded 7/28/00 by John Eppley

Sub DigitalThumbnails()
Msg = "Select a location containing the Photos you want to print."
directory = GetDirectory(Msg)
If directory = "" Then Exit Sub
If Right(directory, 1) < "\" Then directory = directory & "\"

Application.ScreenUpdating = False
On Error Resume Next
With Application.FileSearch
.NewSearch
.LookIn = directory
.Filename = "*.*"
.SearchSubFolders = False
.Execute
i = 1

Set mydir = Range("j1")
mydir.FormulaR1C1 = directory
'mydir.FormulaR1C1 = Left(mydir, Len(mydir) - 1)
'mydir.FormulaR1C1 = Mid(mydir, Find("\", mydir, 4) + 1, 24)
'CopyFolderName

For x = 3 To 13 Step 2
For y = 1 To 7 Step 2

ActiveSheet.Cells(x, y).Select
ActiveSheet.Pictures.Insert(.FoundFiles(i)).Select
Selection.ShapeRange.Height = ActiveCell.RowHeight
ActiveCell.Offset(1, 0).Select
ActiveCell.Formula = Right(.FoundFiles(i), 12)
ActiveCell.Offset(0, 1).Select
ActiveCell.Formula = FileDateTime(.FoundFiles(i))
If .FoundFiles(i) = "" Then Exit Sub
i = i + 1
Next
Next

End With
End Sub




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 files not showing on screen when opened in Excel 2007 [email protected] Setting up and Configuration of Excel 1 January 8th 09 05:45 PM
Conflict in excel 2007 with Outlook 2007 attachment excel narnimar Excel Discussion (Misc queries) 0 December 17th 08 02:02 PM
Labels: Unable to import all records Excel 2007 to Word 2007 Mailm skelly Excel Discussion (Misc queries) 1 October 29th 08 11:22 PM
Excel 2007, I write macros in 2003 is 2007 similar for VBA? Pros andcons please Simon[_2_] Excel Programming 3 August 5th 08 03:48 PM
Excel 2007 Macro Help (Excel 2003 not working in 2007) Pman Excel Discussion (Misc queries) 4 May 29th 08 06:29 PM


All times are GMT +1. The time now is 07:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"