Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-02-2011, 10:17 AM
xena2305 xena2305 is offline Compile error: sub or function not defined.. Windows XP Compile error: sub or function not defined.. Office 2007
Novice
Compile error: sub or function not defined..
 
Join Date: Aug 2011
Posts: 1
xena2305 is on a distinguished road
Default Compile error: sub or function not defined..

Hi,
i got a code that export sheet to a text file from the web, the code works
excelent in my home pc excel 2007 but i get the error i mentioned
when i try to run the same code on my work pc in excel 2003 @2007 both.
google has alot of info about this kind of error but i still cant solve it.
i got the code from http://www.cpearson.com/excel/ImpText.aspx
i attach the first part of the code.

Sub DoTheExport()
Dim FileName As Variant
Dim Sep As String
FileName = Application.GetSaveAsFilename(InitialFileName:=vbN ullString, FileFilter:="Text Files (*.txt),*.txt")
If FileName = False Then
''''''''''''''''''''''''''
' user cancelled, get out
''''''''''''''''''''''''''


Exit Sub
End If
Sep = Application.InputBox("Enter a separator character.", Type:=2)
If Sep = vbNullString Then
''''''''''''''''''''''''''
' user cancelled, get out
''''''''''''''''''''''''''
Exit Sub
End If
Debug.Print "FileName: " & FileName, "Separator: " & Sep
ExportToTextFile FName:=CStr(FileName), Sep:=CStr(Sep), _
SelectionOnly:=False, AppendData:=False
End Sub
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile error: sub or function not defined.. User Defined Default Settings in Insert J_oe Word 1 02-17-2011 10:55 AM
Compile error: sub or function not defined.. Change fonts of a defined word with VBA Michael007 Word 6 02-01-2011 04:52 PM
compile error in Word raco Word 0 09-28-2010 12:40 PM
TOC printing Error Bookmark not Defined techexpressinc Word 0 12-14-2008 05:24 PM
Compile error: sub or function not defined.. Defined Views in Tasks Inga Office 3 07-20-2005 07:10 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:16 AM.


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