I have an entire program written that seems to work every once in a while. The one thing that I CANNOT seem to figure out is the range for my text to columns. It is ALWAYS in cell A1, and the destination is ALWAYS A1. Sometimes it will work, and others it won't. I am puzzled. I am guessing something having to do with declaring object, or activeworkbook.worksheets(1).range("A1") needs to happen but I have tried a ton of things and still get a debug error.
It might be helpful to say I am running this code through outlook, and calling excel. I am unsure if I needed to use "with activeworkbook" and run all my code with that declaration, but I had it then deleted it since I have been getting this error. This is the code for the text to columns. I have a rule set to run this script that saves the attachment, then opens it then needs delimit it. It has run through a few times and when it does it is exactly how I want it. I am guessing this is a simple fix. Thanks in advance!
![]()
Dim rng As range Set rng = ws.range("A1") rng.TextToColumns Destination:=rng, DataType:=xlDelimited, _ TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=True, _ Semicolon:=False, Comma:=False, Space:=True, Other:=False, FieldInfo _ :=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), _ Array(7, 1), Array(8, 1), Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1 _ ), Array(14, 1), Array(15, 1), Array(16, 1), Array(17, 1), Array(18, 1), Array(19, 1), Array _ (20, 1)), TrailingMinusNumbers:=True
Bookmarks