HTML files convert all cells to text before opening (dropped leading zeros)

D3allamerican07

Board Regular
Joined
Jul 22, 2015
Messages
101
I have a package of html files I open in excel. Unfortunately, opening the file converts the cells to 'General' and drops leading zeros. I have a code to loop through the package, open the files, and copy that sheet to a workbook.

Is there a way to open the file with the columns already as 'Text' to prevent losing those leading zeros or open that file in a sheet with columns already formatted?


Also, once open, it is already to late to use Text-To-Columns. The html file is not delimited either.

Code:
Set wb = Workbooks.Open(FileName:=objFile)

Thank you in advance!
Bill
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

Forum statistics

Threads
1,215,030
Messages
6,122,762
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top