I am using Excel 2010 and have an error with a macro that I have used for the last two years with out a problem. Now when I attempt to run the macro it errors out at .objData.PutInClipboard The issue only happens every other time I run it?
I have two text boxes that get the information that needs to be copied and then pasted both in excel and then again as the file name. Here is what I have...
When I debug the problem appears to be at the objData.PutInClipboard
Since I use this macro over 100 times it is really annoying that this has starting happening... I have tried to clear the clipboard, but that does not seem to work with the issue...
help please
I have two text boxes that get the information that needs to be copied and then pasted both in excel and then again as the file name. Here is what I have...
Code:
Dim actName As String
Dim actNumber As String
Dim objData As DataObject
Dim strClipBoard As String
Set objData = New DataObject
actName = InputBox("Please enter the Account Name", "Account Name")
actNumber = InputBox("Please enter Payer Number", "Payer Number")
Range("A1").Value = actName & " - " & actNumber
objData.SetText ""
objData.PutInClipboard
strClipBoard = actName & "-" & actNumber
objData.SetText strClipBoard
objData.PutInClipboard
Application.Dialogs(xlDialogSaveAs).Show
When I debug the problem appears to be at the objData.PutInClipboard
Since I use this macro over 100 times it is really annoying that this has starting happening... I have tried to clear the clipboard, but that does not seem to work with the issue...
help please