Opening Unicode CSV File Using Opentext

Jul 7, 2012

I have written code to export data from excel as a unicode .csv file - see [URL] .....

However I now want to open that file by vba, yet it does not format the data correctly. I have a field in the delimited data that is string (in my .csv file strings are surrounded by " to indicate strings). This string can contain a vbLf as part of the string ie. the string goes over a couple of lines in one cell.

Using vba I open the .csv file as follows:

Code:
Workbooks.OpenText filename:=singlefname, origin:=65001, DataType:=xlDelimited, textqualifier:=xlTextQualifierDoubleQuote, comma:=True

yet when the code opens the file the vbLf starts a new worksheet row messing up the layout of the .csv file. It should just indicate a new line in a cell.

How to open the file so the vbLf only creates new line in the cell does not start a new worksheet row?

View 8 Replies


ADVERTISEMENT

Excel 2002 :: Does Saving File As Unicode Save It In UTF-8 Or UTF-16 Format

Jan 14, 2011

what format is used when you save an excel file as "unicode." I am using excel 2002 on XP.

I have been asked to provide a UTF-8 formatted unicode file for use by another program but I am not sure which formatting excel uses.

View 3 Replies View Related

Opening A File Without Opening A Workbook

Apr 17, 2007

I have a need to open a file from my companies intranet. My current method was to open said file via the method that the recorder gave me. However, I would like ot be able to open a said file without having to start open another workbook.

This is the path:
[url]

So the command is this:
Workbooks.Open [url]

Links are not actual links

So what I need to know. Is how can I open this file without opening a workbook. I haven't been able to use the VB "Open Statement" to open a file and I don't believe that I've been successfull using the Filesystem object either.

View 9 Replies View Related

Opening Excel File From List Of File Names Located In Single Sheet?

May 31, 2013

loop and range function to apply in the below code through which I can avoid writing code for all the rows.

I am trying to open excel files located in single folder from files name (along with the path) in single worksheet (Column B and Row 1 to 500).

I have created follwing code which opens the file and then runs a macro in it.

a Sub Test()
Dim strFName As String
strFName = Sheet1.Range("B2").Value

[Code].....

View 4 Replies View Related

VBA Code For Opening File With Variable Version Number In File Name?

Jan 29, 2014

I have a file that I save with a new version number each time I make major changes. The file name currently is: "Telephony Equipment Inventory v26 (Summary).xlsm". The "26" is the variable number. give me the vba code to ensure I open the file with the highest version number?

View 6 Replies View Related

OpenText Into Existing Worksheet?

Sep 26, 2006

I would like to Import a Text file into a current Workbook with the worksheet name GLFBCALO. The macro below creates a new workbook instead of imported the data to existing sheet, GLFBCALO. Is there a way to use the OpenText method to import data into an existing worksheet?:

Public Sub ImportOKdata()
Dim MyFile As String
Dim ColumnsDesired

[Code]......

View 3 Replies View Related

Worksheet.Opentext Failure?

Jan 7, 2009

I am struggling with the Worksheet.Opentext code required to open a text file in excel - specifically with the date format.

For example, I have a text file containing Feb08.

When opened manually using space as deliminator it correctly returns 01/02/2008.

However, when I record the same opening action as a macro and then run same macro it returns 08/02/2009, which is incorrect. Try it and see for yourself!

View 7 Replies View Related

OpenText Function In Macro Hangs Unless Stepping Through Code In Debug

Oct 29, 2009

We have had a macro running for a few years (Excel 2007 now, but started in 2003) that imports about 35 text files into separate sheets, creates a calculated SUM field for each sheet and copies that value to a title (or summary) sheet. We use this 2 to 4 times per year at inventory time, copying to a new file and deleting the old data before running the macro. The imported files initially create new workbooks, but the data is copied to the initial workbook into a distinct sheets for each file.

Recently (well, last August) this macro started hanging after importing (Workbooks.OpenText) a number of files, and not necessarily the same file every time (on repeated runs.) While trying to figure out the problem, I have now managed to get it to hang every time on the first file! However, if I am stepping through in the debugger it continues past the OpenText command and on F5:Run/Continue will then continue processing the rest of the files normally. If I delete the first file before running the macro, it then hangs on the second file instead.

Without debugging, the first file will import, display on-screen, and there it stops. If I put a break-point on the very next instruction after the import, that break-point is never reached. THINGS I'VE TRIED:.......

View 2 Replies View Related

Opening A File ...

Sep 18, 2008

I am trying to do something simple but not quite sure how to do it. I am using the GetImportFileName and then selecting information of one sheet from that file and copying to another workbook. I need to know how to then get back to the file I have opened to search the next sheet and so on. The problem I have is with this line.

Workbooks(FileName).Activate

Sub GetImportFileName()
Dim Finfo As String
Dim FilterIndex As Integer
Dim Title As String
Dim FileName As Variant

' Set up list of file filters
Finfo = "All Files (*.*),*.*"

' Display *.* by default
FilterIndex = 5

' Set the dialog box caption
Title = "Select a file to Import"

' Get the Filename
FileName = Application.GetOpenFilename(Finfo, FilterIndex, Title)

' Open the Filename
Workbooks.Open FileName

WPD
End Sub

View 9 Replies View Related

Opening PDF File

Mar 12, 2006

When I press the button , i would like to open PDF file. The path is "\ engineeringABC.pdf"

View 2 Replies View Related

Opening A Powerpoint File

Sep 22, 2008

I have some VBA code that allows the user to open a linked powerpoint presentation from an Excel workbook. It works well but it does not ask the the user to update links so if the Excel book has changed the powerpoint stays the same. I am very new to VBA so I tend to copy things that work but don't always know why! Anyone out there know how to get it to update links automatically or at least ask the user to do so? Here is the code:

View 2 Replies View Related

Opening File With Dated Name Each Day?

Oct 20, 2009

I would like to open a certain file everyday. However each day this file is created and named with the date, for example Production_FixYYYYMMDD.csv, in VBA how do I accomplish this? The alternative I could think of is to create a .bat file to copy that file over to a separate directory and rename it Production_Fix.csv and just use that, but if that batch file fails to run that would cause issues.

View 4 Replies View Related

File In XLSTART Not Opening

Dec 29, 2009

Any idea why a file in my XLSTART folder does not open when I start Excel?

I had a cell in a file (not one of the files in XLSTART folder) that was refered to by thousands of other cells. I clicked on Trace Dependents and Excel then spent the next 10 minutes trying to point to all the cells. I eventually gave up and used the Windows Task Manager to close Excel. Ever since then Excel doesn't open 1 of the 3 files I have in the XLSTART folder.

View 6 Replies View Related

Macro- Opening A File

Aug 19, 2008

I'm looking for a command for a macro, haven't been able to find it thus far. Is it possible to get excel to open a .txt for example, and copy its contents into excel at an activecell?

View 9 Replies View Related

Opening Large File

Feb 4, 2009

I have a 14.3 MB xlsb file that I am trying to open with no success as it just hangs. Anyone have any ideas on how to get the data out of there? I would like to be able to get the data to a pivot and copy the pivot to another file to try and reduce the load on one file. I tried to import to Access but was told I was using a file version before 2007, which is impossible since it is a xlsb file.

View 9 Replies View Related

Personal File Not Opening

Jun 6, 2006

I am having a problem that shouldn't be that hard to fix, but I can't seem to figure it out. I have a file in the xlstart folder, called "personal.xls" with macros in it. The security level is at low, it isn't on the disabled list, and it won't automatically open when excel opens. If I double click on it, it opens. It just won't open when excel is first started. Is there any way to correct this?

View 2 Replies View Related

Dropdown Range Changes When Re-opening File?

Mar 1, 2013

I have a list of expenses on a certain project. I allocate each line to a certain type of expense by using a dropdown list. When re-opening the file, the first few lines were good: dropdownOK.jpg

But after a few lines, the dropdown range changed, although it keeps the selection I made in the previous version: dropdown_wrong.jpg

I have seen that the data validation list changed to =$A$2:$A$17 instead of my separate list =Dropdown!$A$2:$A$17 but cannot understand why excel has made this twist. Each month I update this list, which means adding lines to the list, both inserting them at the bottom, as in between other lines. I can't see any pattern, because it kept the range of the first 6 lines, when the previous version already had 50 lines or so. It does not only happen to the inserted lines, for example.

View 1 Replies View Related

Opening An File From A Cell Reference

Nov 12, 2008

I want to use a macro to open an existing file on my c drive where the reference to that file is contained in a cell.

E.g. In my sheet, the cell A1 contains the following text "C:Documents and SettingsTest". Therefore the file I want to open using a macro will be Test.xls.

However the file I wish to open (and therefore the reference text in cell A1) could change (and it could also change to be a word document) so it needs to be able to adapt when a new valid file (and document type) reference is entered into the cell.

Also, as an aside, when I want to change the file referred to in A1, the easiest way I've found is to find the file I want in windows explorer, go to properties and copy the file reference and then paste it into A1. However the reference (from the properties tab) seems to miss the ".xls" or ".doc" at the end (see above). Is this an issue? If yes, then I'm happy to manually type the .xls or .doc extension at the end.

Is there an easier way to do this?

View 10 Replies View Related

Determine If A File IS A Workbook Before Opening

Aug 6, 2009

Is there anyway I can test / inspect a file before attempting to open it to check that it is indeed an Excel workbook?

I don't want to do it by file extension as that can / will be changed, but rather wondered if there was anyway to examine the ACTUAL file?

I'm wondering if all Excel workbook files start with a particular section of data or anything?

View 5 Replies View Related

Change DisplayCommentIndicator Upon Opening File

Aug 6, 2009

I am trying to turn off DisplayCommentIndicator when anyone opens this one file. I started with this not sure why its not working.

Private Sub Workbook_WindowActivate()
Application.DisplayCommentIndicator = xlNoIndicator
End Sub

also after anyone closes the file turn the comment indicator back on.

View 2 Replies View Related

Opening A FILE Give An Alarm

Nov 29, 2006

I have a training list file i made in excel that I put what people are trained on, the date they were trained and automatically it adds 2 years to the next column for when they need training again.

What I would like to do is make a macro, that will pop up a box (upon opening the .xls file) that states any of the employee who are due to be retrained, as well as what items they need retraining on.

View 9 Replies View Related

Rename Worksheet With Opening The File

Dec 12, 2008

I have the following code, which I use to open up a .xls file generated from Crystal Reports:

Application.ScreenUpdating = False
Application.DisplayAlerts = False

Dim fexport1 As String ' variables for the exported file
Dim fexport2 As String
Dim wb1 As String 'variables to change between the opened workbooks
Dim wb2 As String
strTemp = "Please Choose The Exported File"
MsgBox strTemp
fexport1 = Application.GetOpenFilename("Excel Files (*.xls), *.xls)")
If InStr(fexport1, "False") = 0 Then
Workbooks.Open fexport1
wb1 = ActiveWorkbook.Name

Else
strTemp = "Operation Canceled"
End If

The problem is that Crystal Reports generates the file with an invalid worksheet name (it contains a backslash) and I do not have access to modify the Crystal Report. Althought the file can be automatically repaired by Excel when manually opened, the macro chokes and the "Application.DisplayAlerts = False" does not fix it. The only solution I can think of is renaming the worksheet without opening the file.

View 9 Replies View Related

Paste Data In A File Without Opening It

Apr 29, 2009

Is there a way to paste data in a file without opening it?

View 21 Replies View Related

Excel Files Opening As Different/new File

Jan 12, 2010

I'm using Excel 2007. I didn't change a single option but for some reason this problem came up. When I open an already saved Excel file it opens up in a newly created file. For example, if I open a file saved as "Monthly Sales" it will open it up and rename it as "Monthly Sales1." When I go to save it again, which would normally just save it where it currently sits, it basically acts as if I hit Save As and pops up the box asking me where I want to save it. This is extremely annoying as most of the places where these files are saved are several folders deep which makes it time consuming every time I open and alter a file. I can't find any options that looks something like this and it only happens in Excel.

View 9 Replies View Related

Opening Multiple Files Into One File

Mar 1, 2010

Ive got about 300 different excel files all with the exact same format the only thing that is different is the values in the columns but they are all raw reports dumped into excel.

because I had to run them all seperate for certain reasons is there a way to combine all these files into one file without copy pasteing them all into one sheet.

View 9 Replies View Related

Personal.xls File Not Opening With Other Workbooks

Aug 25, 2008

I have a problem when opening Excel work books, The Personal file will not open automaticly. The file is in the XLStart folder. The link is "C:Documents and SettingsUSERApplication DataMicrosoftExcelXLSTARTPERSONAL.XLS. I have a desk top short cut I need to open first manually. Also the menu bar short cuts I had to my VB code and Macros will not work. Any body have any ideas what the problem may be? Im sure its a simple link problem but I don't know where to look.

View 2 Replies View Related

Opening A .xls File From VB Espress Edition

Apr 17, 2006

how to browse then open a excel file from a button in vb 2005 express edition?

View 3 Replies View Related

Opening A File From Any Active Directory

May 31, 2006

The file that this code is located in is often sent to others to use which means I have to modify the directory and path each time I send this file in order for the VB code to work.

Workbooks.OpenText Filename:= _
"C:My documents-2Monthend Supplemental ReportsDeficiency ReportscurrentC37.txt"

Is there a way to have the file opened from any active directory it happens to reside in?

View 9 Replies View Related

Macro Stops After Opening A Given File

Jul 10, 2006

I am wirking on a macro which opens a 'sourcefile' and then do some filtering and vlookuping to distribute the data to several files. When i run the macro from the VBA editor, everything runs fine. But if i run it from .xls file, the macro stops after opening the 'sourcefile'

Workbooks.Open Filename:=sourcefile
For i = 0 To 13
'do something...
Next

View 9 Replies View Related

Stop OK On FollowHyperlink Opening File

Nov 28, 2007

I've got the following vba code: (not sure if im in the right forum? )

ActiveWorkbook.FollowHyperlink Address:="http://blah/blah/blah/Pipeline Submissions/" & CountryOnly & "/" & useronly & "/Published Reports" & "/Pipeline_" & DateOnly & ".xls"

And use this to open country workbooks in turn, and get the info out of each and paste into one big, 'consolidated' report. This is all done in a loop.

My question is, how can I stop the dialog box that comes up asking a user to OK the opening of the file? I used to have workbooks.open("\....") way of doing it and turned off display alerts, but I had to change due to moving server, and now I've got it popping up again.

Is there any way to stop it (or an alternative way of opening)- as if you have 7 or so message boxes like this is quite annoying.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved