Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-09-2017, 05:39 AM
Alimou Alimou is offline Help with my macro - Error message Windows 8 Help with my macro - Error message Office 2013
Novice
Help with my macro - Error message
 
Join Date: Jan 2016
Posts: 4
Alimou is on a distinguished road
Default Help with my macro - Error message

Hi,


Need help please. Any idea why VBA is returning the error message "invalid use of Null”?

Many thanks




Code:
Sub CreateEviewsPrg()

Dim ItemName, nameoffile As String
Dim stufftocopy As Variant
Dim fso, oFile As Object
Dim crange, c, loc As Range

'Set folder = Sheets("Parameters").Range("C9").Value

With Worksheets("Prg_xSc")

            nameoffile = .Cells(1, 1).Value
            Set crange = Range(.Cells(1, 2).Value) 
            Set stufftocopy = crange
            Set c = stufftocopy
            ItemName = ItemName + c.Text + vbCrLf
                
            Set fso = CreateObject("Scripting.FileSystemObject")
            Set oFile = fso.CreateTextFile("\\xxx\Eviews\" + CStr(nameoffile) + ".prg")

            oFile.WriteLine CStr(ItemName) 'ERROR HERE: "invalid use of Null”

            oFile.Close
            Set fso = Nothing
            Set oFile = Nothing
            

End With




End Sub
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
macro error message - interpretation H28Sailor Excel Programming 3 03-03-2017 07:37 AM
Help with my macro - Error message Reserved error(-1517); there is no message for this error ktest Office 1 02-12-2016 08:08 PM
Help with my macro - Error message 5941 error message in macro used in merge moneal62 Word VBA 6 01-18-2016 07:54 PM
Help with my macro - Error message Automation error Unknown error" message once they open the Excel file hlina Excel 1 10-08-2013 09:14 PM
Error message White House Outlook 1 12-07-2010 04:52 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:50 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft