GemaDilemma
New member
- Local time
- Today, 06:18
- Joined
- Aug 19, 2013
- Messages
- 2
I have a problem that has stumped me for the last day.
I have a GetUserName Api which extracts the name of the current user, it works perfectly.
I also have an unbound OLE Object that is being controlled on form load by this.
With Me.OLE1
.Class = "Excel.Sheet"
.OLETypeAllowed = acOLELinked
.SourceDoc = "C:\Users\" & GetUserName & "\Desktop\Database\Excel Files\Bulk Updating.xlsm"
.SourceItem = "R1C1:R5C5"
.Action = acOLECreateLink
.SizeMode = acOLESizeClip
End With
When I run the code I get Runtime Error 2101 on Line 4.
When I set Line 4 to Jblogs instead of my get user function it works fine.
Any Help?
Gema
I have a GetUserName Api which extracts the name of the current user, it works perfectly.
I also have an unbound OLE Object that is being controlled on form load by this.
With Me.OLE1
.Class = "Excel.Sheet"
.OLETypeAllowed = acOLELinked
.SourceDoc = "C:\Users\" & GetUserName & "\Desktop\Database\Excel Files\Bulk Updating.xlsm"
.SourceItem = "R1C1:R5C5"
.Action = acOLECreateLink
.SizeMode = acOLESizeClip
End With
When I run the code I get Runtime Error 2101 on Line 4.
When I set Line 4 to Jblogs instead of my get user function it works fine.
Any Help?
Gema
Last edited: